嗨,大家好
我有一个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。
<platform name="ios">
<config-file target="*-Info.plist" parent="UIBackgroundModes">
<array>
<string>remote-notification</string>
</array>
</config-file>
</platform>
这为我修好了。