Cordova上的Firebase不会在iOS设备上触发通知

编程入门 行业动态 更新时间:2024-10-28 02:25:24
本文介绍了Cordova上的Firebase不会在iOS设备上触发通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Cordova为iOS版和Android版开发应用程序. 我已经安装了此插件: phonegap-plugin-push 并可以在Android上运行. 关于iOS,我已经将Firebase项目中的che证书安装到了控制台中. 实际上,当我尝试运行通知进行测试时,会看到以下内容:

I'm making an app for iOS ed Android with Cordova. I've installed this plugin: phonegap-plugin-push and works on Android. So about iOS, i've installed che certificates in the Firebase project into console. Infact when i try to run notifications for testing i see this:

17个相关的应用程序用户是我已经完成的有关令牌通信的测试. 该证书是从Apple开发人员控制台创建的.p8证书,我认为我所做的是正确的,因为我们可以在firebase控制台上看到设备注册:

17 app users associated are the testing I've done about the token communications. The certificate was create .p8 certificates from apple developer console, and i think is correct what I done, because we can see the devices registration on firebase console:

该项目还包含以下广告连播:

The project have also the pods:

Analyzing dependencies Downloading dependencies Using FirebaseAnalytics (4.2.0) Using FirebaseCore (4.0.20) Using FirebaseInstanceID (2.0.10) Using FirebaseMessaging (2.0.8) Using GoogleToolboxForMac (2.1.4) Using Protobuf (3.6.1) Using nanopb (0.3.901) Generating Pods project Integrating client project Sending stats Pod installation complete! There is 1 dependency from the Podfile and 7 total pods installed.

和Xcode功能:

所以问题是,为什么在iOS上通知不起作用?有什么建议?为什么没有东西触发设备? 我使用Visual Studio Code,并且该项目位于Apache Cordova上.

So the questions is, why on iOS the notifications doesn't works ? Any suggestions? Why nothing triggering the devices ? I use Visual Studio Code, and the project is on Apache Cordova.

推荐答案

构建此插件需要Xcode 8.0或更高版本.

Xcode version 8.0 or greater is required for building this plugin.

CocoaPods

CocoaPods

Required cordova-cli minimum version: 6.4.0 Required cordova-ios minimum version: 4.3.0 Required CocoaPods minimum version: 1.0.1

要安装CocoaPods,请遵循安装说明此处.安装CocoaPods后,请运行:

To install CocoaPods, please follow the installation instructions here. After installing CocoaPods, please run:

pod setup

如果您正在使用npm安装此插件,并且正在使用cordova-cli的6.1.0或更高版本,它将自动为您的平台和cli下载该插件的正确版本.

If you are installing this plugin using npm, and you are using version 6.1.0 or greater of the cordova-cli, it will automatically download the right version of this plugin for both your platform and cli.

如果您的cordova-cli版本低于6.1.0,则必须升级cordova-cli版本,或显式安装插件:

If you are on a cordova-cli version less than 6.1.0, you will either have to upgrade your cordova-cli version, or install the plugin explicitly:

cordova plugin add phonegap-plugin-push@1.8.1

如果您在Xcode中打开应用程序,则会收到类似以下的错误消息:

If you open the app in Xcode and you get an error like:

ld:找不到用于-lPods-Appname的库 铛:错误:链接器命令失败,退出代码为1

ld: library not found for -lPods-Appname clang: error: linker command failed with exit code 1

Then you are opening the .xcodeproj file when you should be opening the .xcworkspace file.

,如果u使用的是最新版本o xcode(10),并且如果您使用ionic 3,则需要以这种方式构建

and with if u are in the latest version o xcode (10) u need to build this way if u use ionic 3

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

此答案的来源-> 这里

更多推荐

Cordova上的Firebase不会在iOS设备上触发通知

本文发布于:2023-10-29 10:44:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539477.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会在   通知   设备   Cordova   Firebase

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!