I tried to test my app on an Ios device via usb. I managed to load my application on the phone with xcode, it seems to work fine. This application has been made with Nativescript + VueJs and I want to test notifications with Firebase Messaging (this works fine on android).
The problem that I have is that I can't get the uniq token from FCM and I got this message :
APNS device token not set before retrieving FCM Token for Sender ID '**********'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.
I don't know what to do, I request permission has in this page : https://docs.nativescript.org/plugins/firebase-messaging.html#ios-requesting-permissions
import { firebase } from '@nativescript/firebase-core'
import '@nativescript/firebase-messaging' // only needs to be imported 1x
async function requestUserPermission() {
const authStatus = await firebase()
.messaging()
.requestPermission({
ios: {
alert: true
}
})
const enabled =
authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
authStatus === messaging.AuthorizationStatus.PROVISIONAL
if (enabled) {
console.log('Authorization status:', authStatus)
const didRegister = await firebase().messaging().registerDeviceForRemoteMessages()
}
}
The prompt alert works fine and I "allow" notifications, but the I can't get the token from FCM for Firebase-messaging....
This is not a test on simulator, it is a test on a real device...
Thanks for any suggestion or solution !