isuru
isuru

Reputation: 3565

How to get FCMToken in Firebase on ios?

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?

Upvotes: 6

Views: 4952

Answers (1)

HeadOnn
HeadOnn

Reputation: 1490

Try using :

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

For more information on this, please follow: stackoverflow post

Upvotes: 10

Related Questions