Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes #113, where push notifications were sometimes not reaching the app when users did not implement
UNUserNotificationCenterDelegate
methods.Description
We’ve introduced conditional logic for proxying
UNUserNotificationCenterDelegate
methods:To account for cases where users don't implement
UNUserNotificationCenterDelegate
methods, we have added a fallback swizzling ofUIApplicationDelegate.application(_:didReceiveRemoteNotification:fetchCompletionHandler:)
. This ensures that notifications are still captured by the SDK, even when no delegate is explicitly handling them.Warning
This does not handle cases where an app receives push notifications but does not implement any handling logic (e.g., neither
UNUserNotificationCenterDelegate
methods norUIApplicationDelegate.application(_:didReceiveRemoteNotification:fetchCompletionHandler:))
. In such scenarios, push notifications will still be received by iOS but we'll not be able to capture them.