Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: forward push received app in foreground events to 3rd party call…
…backs Part of: https://linear.app/customerio/issue/MBL-138/[bug]-ios-customers-receive-callbacks-from-3rd-party-sdks-for-pushes When a push is received while app in foreground, send the push event to other push event handlers in host app. Giving customers the opportunity to process the push event. Previously, only non-CIO pushes would be sent to other push event handlers. Notes: * CIO SDK waits for all push handlers to call completion handler for push processing. Not calling completion handler may result in push not being shown while app is in foreground. Push event handlers must call async completion handler for CIO SDK to handle push events. Test function `test_givenMultiplePushHandlers_givenCioPushDelivered_givenOtherPushHandlerDoesNotCallCompletionHandler_expectCompletionHandlerDoesNotGetCalled` reproduces scenario. Waiting for completion handler prevents premature termination of push processing logic by iOS. Apple documentation states completion handler must be called after processing push event. https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/usernotificationcenter(_:willpresent:withcompletionhandler:) * The SDK now determines if a push should be shown for non-CIO pushes and fixes bug in `PushEventHandlerProxy`. This change had to be made as part of waiting for all push handlers to complete async operation. Behavior before: The push handler that called the async completion handler first would be the one that decides if the push is displayed on the device. After behavior: The SDK uses Apple's default of not displaying push. The SDK will display the push if at least 1 of the push handlers decides to display push. This aligns with Apple's default behavior of not displaying a push unless at least one push handler decides to display it.https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/usernotificationcenter(_:willpresent:withcompletionhandler:) commit-id:91fe252e
- Loading branch information
1 parent
121b157
commit bd55e2b
Showing
5 changed files
with
291 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.