Always forward received UNNotifications #1604
Merged
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.
to an overridden user delegate, even before the messaging SDK is initialized.
Description
messaging.mm sets up a UNUserNotificationCenterDelegate in RequestPermission. If any other delegate was already set, it is designed to forward incoming notifications to the previous delegate in
-[UIApplication userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]
. However, RequestPermission may be called before Messaging is initialized, in which case these notifications were not being forwarded. If any user notifications come in before Firebase Messaging is initialized, the notification is lost.This is the cause of firebase/firebase-unity-sdk#377 as well as Unity-Technologies/com.unity.mobile.notifications#316
Notifications should now be forwarded to the overridden delegate, whether Messaging is initialized or not.
Type of Change
Place an
x
the applicable box: