簡體   English   中英

Cordova-plugin-firebase:無法在iOS 12.2上運行,但可以在android和iOS 10.3.3上正常運行

[英]Cordova-plugin-firebase: Cannot run on iOS 12.2 but works without any problems on android and iOS 10.3.3

Hej Guys

我有一個cordova-plugin-firebase版本為2.0.5的cordova應用程序。 該插件在android和iOS 10.3.3上運行良好。 從Firebase和我們的通知服務器接收到的通知都沒有任何問題。

問題出在iOS 12上。在iOS 12.2上,該應用程序可以正常啟動,運行grantpersmission代碼,並通過授予權限對話框提示用戶,但嘗試獲取令牌時,如下所示:

window.FirebasePlugin.getToken(function (token) { backend_registration(token); console.log(token); }, function (error) { console.error(error); });

永遠不會調用getToken / onTokenRefresh回調,並且應用程序崩潰。 如果我注釋掉用於注冊通知/ firebase應用的代碼,則該應用不會崩潰。

科爾多瓦-cli:7.1.0科爾多瓦-ios:4.5.5

希望有人可以指出解決方案。

我也創建插件GitHub的頁面,在這里我也附Xcode的日志上一個問題在這里

  1. 首先,我在文件->項目設置中將構建系統更改為傳統。
  2. 其次,我使用了身份驗證APN密鑰(不是介質指南中提到的證書,請參閱https://firebase.google.com/docs/cloud-messaging/ios/certs )。
  3. 添加到config.xml

     <platform name="ios"> <config-file target="*-Info.plist" parent="UIBackgroundModes"> <array> <string>remote-notification</string> </array> </config-file> </platform> 

這為我解決了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM