[英]Ionic Push FCM iOS - get device token (not firebase token)
當我在 iOS 上使用FCM(Firebase Cloud Messaging) cordova plugin
時,我得到這個令牌:
c-NtgjPB8Rg:APA91bEk0bvwec5tGjzCYQ_0I2axwpFmuRJ1JRUpHwdcTkVV1J1AR_Xb3p7qYp68il0y_TmiJ4ecQYDQdCFDLwzA-KALA_I7Q2tUOW2zszsDA0lPD8tvo0IlRYhf1Z5KwhR5u6h02z2w
但它應該是這種格式:
3b985a82 451ef20d f6f6e481 8de19a3d 1855e6de daf09915 e9b8a42b 3c05c79c
我正在使用這種方法:
this.fcm.getToken().then(token => { /*saving token here*/});
我是否收到某種Firebase令牌? 如何獲得APNS令牌?
你得到的令牌看起來是正確的,它與我得到的完美工作的令牌非常相似。 它不應該有任何空格。
您可以使用 getAPNSToken() 函數:
this.fcm.getAPNSToken().then(token => { /*saving token here*/});
您也將驗證平台:
if (this.platform.is('android')){
token= await this.fcm.getToken();
}
if (this.platform.is('ios')) {
token= this.fcm.getAPNSToken()
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.