firebase icon indicating copy to clipboard operation
firebase copied to clipboard

[@nativescript/firebase-messaging-core] APNS token is no longer returned, only FCM-token

Open BozzaDaniel opened this issue 3 years ago • 3 comments

In release 2.5.2 the APNS-token is not available, only the FCM token is. Even running this will return the FCM-token:

MessagingCore.getInstance().getAPNSToken()

In 2.5.1 the APNS token is returned as expected.

BozzaDaniel avatar Jan 13 '23 13:01 BozzaDaniel

Facing the same issue, running firebase().messaging().getAPNSToken() for iOS device returns TypeError: Cannot read property 'APNSToken' of null.

Any solution?

mrzahidjabbar avatar Apr 13 '23 10:04 mrzahidjabbar

Hello, i'm facing the same issue. I've upgraded the older firebase plugin @nativescript/firebase for @nativescript/firebase-core and @nativescript/firebase-messaging

Jonathan64340 avatar May 26 '23 07:05 Jonathan64340

Same here:

aPNSToken null
Error: The operation couldn’t be completed. No APNS token specified before fetching FCM Token

Code:

let aPNSToken: string | null = firebase().messaging().getAPNSToken();
    console.log('aPNSToken', aPNSToken);
firebase().messaging().getToken().then((token) => console.log('TOKEN',  token)).catch(error => { console.log('error', error) });

There is q question though, I'm using the Simulator will it have an apnstoken should it work or only on real iPhone device?

lano-vargas avatar Oct 05 '23 14:10 lano-vargas