繁体   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