-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pre-existing notification delegate #926
Fix pre-existing notification delegate #926
Commits on May 12, 2021
-
Fixed swizzling test to not create side effects
* Issue was that the DummyNotificationCenterDelegate was going out of scope and getting removed. - This created an issue where OneSignal swizzling was no longer wroking, which broke any notification open tests.
Configuration menu - View commit details
-
Copy full SHA for e3ebcec - Browse repository at this point
Copy the full SHA e3ebcecView commit details
Commits on May 13, 2021
-
mv swizzling of delegate into its own method
* Moved swizzling logic in setOneSignalUNDelegate into swizzleSelectorsOnDelegate - No logic changes just a move. * This cleans up code a bit and also makes it more testable.
Configuration menu - View commit details
-
Copy full SHA for 45b4c1b - Browse repository at this point
Copy the full SHA 45b4c1bView commit details -
Added restoreDelegateAsOneSignal
* Added this method on a new helper to undo swizzling in test * This way there is zero carry over side-effects on other tests
Configuration menu - View commit details
-
Copy full SHA for 8735eda - Browse repository at this point
Copy the full SHA 8735edaView commit details -
mv testAUNUserNotificationCenterDelegateAssigningDoesSwizzle
* Moved this test into it's own testing file. - We will be adding more swizzling tests in (a) up comming commit(s)
Configuration menu - View commit details
-
Copy full SHA for b2869cb - Browse repository at this point
Copy the full SHA b2869cbView commit details -
mv registerAsUNNotificationCenterDelegate
* Moved registerAsUNNotificationCenterDelegate out of OneSignalHelper and into OneSignalUNUserNotificationCenter - This better encapsulates this logic * Added a new setup method that OneSignal class. - Before OneSignal had to call two methods which as client shouldn't have to know or care about it at that level.
Configuration menu - View commit details
-
Copy full SHA for 8d3d779 - Browse repository at this point
Copy the full SHA 8d3d779View commit details -
Failing test of pre-existing delegate issue
* OneSignal is normally loaded into memory and it performs swizzling before any code is exlcude as it happens in +load. This is not always the case however so this simulates so other code winning the setDelegate race. * Added putIntoPreloadedState helper to simulate OneSignal class not being loaded into memory yet.
Configuration menu - View commit details
-
Copy full SHA for fd084ff - Browse repository at this point
Copy the full SHA fd084ffView commit details -
Fixed Pre-existing Notification Delegate
* This happens when another library's delegate is loaded before OneSignal's delegate code. * This commit solves it by reassigning the pre loaded delegate to swizzle in OneSignal's logic
Configuration menu - View commit details
-
Copy full SHA for 14c11ba - Browse repository at this point
Copy the full SHA 14c11baView commit details -
Improved registerDelegate comment
* Updated the comment to better fit what we added in the else statement from our last commit.
Configuration menu - View commit details
-
Copy full SHA for a2322e7 - Browse repository at this point
Copy the full SHA a2322e7View commit details