onMessage now works correctly for data-only, notification-only & data-notification messages. Previously it only worked for data-only messages
setBackgroundMessageHandler now works when the app fully quit or backgrounded, for data-only, notification-only & data-notification messages. Previously, when the app was fully quit, events were not being handled
for iOS this requires content-available to be set
add better handling for messages in cases where no user handler has been set
Android: ensure a default notification color is always present when user does not set one
iOS: calling registerDeviceForRemoteMessages/registerForRemoteNotifications was incorrectly causing permissions to be requested before explicitly requesting them via the messaging API
iOS: registering the device was not being called if it was already registered internally.
Devices should always register with registerDeviceForRemoteMessages, as per Apple guidelines, regardless of current registration status.
Make sure you always call registerDeviceForRemoteMessages during your app initialization on iOS
iOS: in cases where requesting an FCM with the default scope & authorizedEntity, the underlying code now uses the recommended instanceIDWithHandler vs tokenWithAuthorizedEntity.
This fixes an issue where FCM would throw a "The operation couldn’t be completed" error (#2657)
iOS: direct FCM connection is now fixed.
When the app was in the foreground, data-only messages were not coming through, they are now.
iOS: when running debug build, the APNs token will be registered with FCM as a "sandbox" key type
iOS: the original APNs swizzling we implemented was not functioning correctly with application:didReceiveRemoteNotification:fetchCompletionHandler:.
We added additional logic whereby this is executed in all scenarios (foreground/background/quit) and replaces a deprecated Apple API.
This fixes issues with data-only messages not being handled by the device
iOS: any custom FIRMessagingDelegate methods you add to your AppDelegate.m will now also be called internally by React Native Firebase messaging.
registerForRemoteNotifications has been deprecated in favor of registerDeviceForRemoteMessages.
It will be removed in a following major version. Underlying functionality has not changed - renamed to avoid confusion with messages vs notifications. (#d66a611)
isRegisteredForRemoteNotifications has been deprecated in favor of isDeviceRegisteredForRemoteMessages.
It will be removed in a following major version. Underlying functionality has not changed - renamed to avoid confusion with messages vs notifications. (#d66a611)
unregisterForRemoteNotifications has been deprecated in favor of unregisterDeviceForRemoteMessages.
It will be removed in a following major version. Underlying functionality has not changed - renamed to avoid confusion with messages vs notifications. (#d66a611)