@protocol FIRMessagingDelegate <NSObject>
A protocol to handle events from FCM for devices running iOS 10 or above.
To support devices running iOS 9 or below, use the local and remote notifications handlers defined in UIApplicationDelegate protocol.
This method will be called whenever FCM receives a new, default FCM token for your Firebase project’s Sender ID. You can send this token to your application server to send notifications to this device.
func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String)
- (void)messaging:(nonnull FIRMessaging *)messaging didRefreshRegistrationToken:(nonnull NSString *)fcmToken;
This method is called on iOS 10 devices to handle data messages received via FCM through its direct channel (not via APNS). For iOS 9 and below, the FCM data message is delivered via the UIApplicationDelegate’s -application:didReceiveRemoteNotification: method.
The callback to handle data message received via FCM for devices running iOS 10 or above.
optional func application(received remoteMessage: MessagingRemoteMessage)
- (void)applicationReceivedRemoteMessage: (nonnull FIRMessagingRemoteMessage *)remoteMessage;