-
Notifications
You must be signed in to change notification settings - Fork 23
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: 3rd party SDK compatibility when SDK forwards push events back to us #736
Conversation
…round Part of: https://linear.app/customerio/issue/MBL-364/[bug]-push-notifications-not-showing-while-app-in-foreground-on-ios The CIO SDK forwards push events to 3rd party SDKs. Some 3rd party SDKs send the push event back to the CIO SDK, potentially causing infinite loops. The SDK is designed to handle this. Previously, the responsibility of calling the completionHandler was on the 3rd party SDKs. However, some 3rd party SDKs delegate this responsibility back to us (See: https://linear.app/customerio/issue/MBL-364/[bug]-push-notifications-not-showing-while-app-in-foreground-on-ios#comment-3ae0db4e). This commit addresses that scenario. Testing: * Modified integration tests to cover this scenario. * Added tests for both `onPushAction` and `shouldDisplayPushAppInForeground` delegate functions. * Ran regression QA tests on iOS, RN, and Flutter. Notes for reviewers: - Limited comments in `iOSPushEventListener` intentionally. Test functions and comments in AutomaticPushClickIntegrationTest explain the use cases and reproducing steps.
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as v3 PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other PR, as discussed in comms we are good on this, only minor suggestion/question would be this.
Tests are currently failing but I think that's because device wasn't launched for some reason, lets please make sure tests are passing on CI before we merge it.
I cherry-picked the commit from the code targeting v2 branch. In v2, the logger instance is optional.
SDK binary size reports 📊SDK binary size of this PR
SDK binary size diff report between this PR and the main branch
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #736 +/- ##
==========================================
+ Coverage 56.95% 57.30% +0.34%
==========================================
Files 139 139
Lines 3880 3900 +20
==========================================
+ Hits 2210 2235 +25
+ Misses 1670 1665 -5 ☔ View full report in Codecov by Sentry. |
## [3.2.3](3.2.2...3.2.3) (2024-06-13) ### Bug Fixes * 3rd party SDK compatibility when SDK forwards push events back to us ([#736](#736)) ([ccb0f47](ccb0f47))
Part of: https://linear.app/customerio/issue/MBL-364/[bug]-push-notifications-not-showing-while-app-in-foreground-on-ios
When a push event occurs in an iOS app (such as determining if a push should be shown while app in foreground), the CIO SDK forwards that event to all 3rd party SDKs in the app. Some 3rd party SDKs handle these push events by also forwarding those events back to the CIO SDK. This has resulted in push handling in an app to not behave as expected.
See the ticket and included tests in this PR to learn more about the implementations of these 3rd party SDKs and how we handle them.
Testing:
Note to reviewers: