简体   繁体   English

离子 Android 推送通知在 phonegap-plugin-push 上出错

[英]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.

相关问题 Phonegap-plugin-push通知 - Phonegap-plugin-push notification 收到推送通知时cordova.js发生错误-phonegap-plugin-push,ionic - Error at cordova.js while receiving a push notification - phonegap-plugin-push , ionic 离子 - 安装 phonegap-plugin-push 时出现错误“:processDebugGoogleServices” - ionic - get error ':processDebugGoogleServices' when phonegap-plugin-push installed 带有 phonegap-plugin-push 的空通知 - Empty notification with phonegap-plugin-push 在iOS上为Ionic 2项目安装phonegap-plugin-push时出错 - Getting error when installing phonegap-plugin-push on iOS for Ionic 2 project 在 Ionic 上接收通知附加数据(ionic native push / phonegap-plugin-push) - Receiving notification additional data on Ionic (ionic native push / phonegap-plugin-push) 科尔多瓦编译错误phonegap-plugin-push android - cordova compile error phonegap-plugin-push android 使用phonegap-plugin-push推送针对Apache Cordova Android应用程序的插件通知 - Push plugin notification for apache cordova android app using phonegap-plugin-push 无法安装插件添加phonegap-plugin-push ionic 3 - can't installl plugin add phonegap-plugin-push ionic 3 离子:无法在 ios 应用程序中安装 phonegap-plugin-push - IONIC:Unable to install phonegap-plugin-push in ios app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM