[英]Ionic Android Push Notification getting error on phonegap-plugin-push
I am using Ubuntu(15.10) 64-bit system and I use chrome for my logs.我使用的是 Ubuntu(15.10) 64 位系统,我的日志使用 chrome。
I am trying to do android push notification and http://docs.ionic.io/v1.0/docs/push-from-scratch# using this ionic doc i am trying to do push notification.我正在尝试使用此 ionic doc 进行 android 推送通知和http://docs.ionic.io/v1.0/docs/push-from-scratch#我正在尝试进行推送通知。
when try to install ionic plugin add phonegap-plugin-push
I am getting error like Error: Variable(s) missing (use: --variable SENDER_ID=value).
当尝试安装
ionic plugin add phonegap-plugin-push
我收到错误,如Error: Variable(s) missing (use: --variable SENDER_ID=value).
why this error occurs can any one give me a solution to solve this.为什么会发生此错误,任何人都可以给我一个解决方案来解决这个问题。
As you can see on the installation docs for this plugin ( https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md ) you have to supply a SENDER_ID variable upon installation like this:正如您在此插件的安装文档中看到的( https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md ),您必须在安装时提供一个 SENDER_ID 变量,如下所示:
ionic plugin add phonegap-plugin-push --variable SENDER_ID="your-app-id"
So if you want to support Android devices, your first step would be to go here:因此,如果您想支持 Android 设备,您的第一步就是去这里:
https://console.developers.google.com/iam-admin/projects https://console.developers.google.com/iam-admin/projects
and create a new Project.并创建一个新项目。 The name you supply there (eg "your-app-id") should match the one you pass to the installation command as SENDER_ID.
您在那里提供的名称(例如“your-app-id”)应该与您作为 SENDER_ID 传递给安装命令的名称相匹配。
In case you don't care about Android, it does not matter what you pass there, anything is fine.如果您不关心 Android,那么您在那里通过什么都无所谓,一切都很好。
phonegap plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
In your main config.xml add在您的主 config.xml 添加
<gap:plugin name="phonegap-plugin-push" source="npm" spec="1.5.3" />
by removing通过删除
<gap:plugin name="phonegap-plugin-push" source="npm" />
and it should work.它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.