Cordova-plugin-firebase:无法在iOS 12.2上运行,但在Android和iOS 10.3.3上没有任何问题

问题描述 投票:0回答:1

嗨,大家好

我有一个cordova应用程序与cordova-plugin-firebase版本:2.0.5。该插件在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的应用程序应用程序不会崩溃。

Cordova-cli:7.1.0 Cordova-ios:4.5.5

希望有人能指出我的解决方案。

我还在插件github页面上创建了一个问题,我还附加了xcode log here

ios xcode firebase cordova cordova-plugins
1个回答
0
投票
  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>

这为我修好了。

© www.soinside.com 2019 - 2024. All rights reserved.