As mentioned in Firebase documentation we can retrieve FCMToken as follows.
NSString *fcmToken = [FIRMessaging messaging].FCMToken;
NSLog(@"FCM registration token: %@", fcmToken);
However above returns compile time error Property 'FCMToken' not found on object of type 'FIRMessaging *'
.
How to get FCMToken?
Instead, you should expect that the device token can change at any time. Because your app might unexpectedly get a new token, you should record that token for the user every time your app launches.
Try using :
NSString *fcmToken = [[FIRInstanceID instanceID] token];
For more information on this, please follow: stackoverflow post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With