to an overridden user delegate, even before the messaging SDK is initialized.
Description
Provide details of the change, and generalize the change in the PR title above.
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.
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 https://github.com/firebase/firebase-unity-sdk/issues/377 as well as https://github.com/Unity-Technologies/com.unity.mobile.notifications/issues/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: