Commits
Ely Alvarado authored and GitHub committed bd4dc06a05f
fix(messaging): fix remote notification tokens * Don't abort registerForRemoteNotifications The native call to `registerForRemoteNotifications` shouldn't be aborted even if `isRegisteredForRemoteNotifications` returns `true`. This is because after successful registration on the first boot, on successive boots the app `isRegisteredForRemoteNotifications` will return true, and then `registerForRemoteNotifications` won't be called again and therefore the APNSToken will never be set (because it is only set on the `didRegisterForRemoteNotificationsWithDeviceToken` swizzled by the `FIRMessagingRemoteNotificationsProxy`) * Set APNSToken on didRegisterForRemoteNotificationsWithDevicetoken This is what `FIRMessagingRemoteNotificationsProxy` does, and doing it here seems to avoid the race condition caused by `didRegisterForRemoteNotificationsWithDeviceToken` here being executed first and resolving the promise before the token is set (at least on iOS 12). It doesn't do any damage anyway to do it here first anyway. Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>