How to get FCMToken in Firebase on ios?

As mentioned in the Firebase documentation , we can get FCMToken as follows.

NSString *fcmToken = [FIRMessaging messaging].FCMToken; NSLog(@"FCM registration token: %@", fcmToken); 

However, the above returns a compile-time error Property 'FCMToken' not found on object of type 'FIRMessaging *' .

How to get FCMToken?

+5
source share
1 answer

Try using:

NSString *fcmToken = [[FIRInstanceID instanceID] token];

Read more about this below: postoverflow post

+6
source

Source: https://habr.com/ru/post/1268623/


All Articles