简体   繁体   English

PushPlugin / cordova onnotificationgcm没有被解雇

[英]PushPlugin /cordova onnotificationgcm not being fired

Hi i'm working on notification push with Cordova/Ionic and i try to get the registration Id of the device (i tried with my phone and simulator) the problem is when the device ready being called the SuccessHandler return success 'Ok'but onNotificationGCM not being fired, my project id is correct and Google Cloud Messaging for Android api is activated in the google cloud console and Internet is also activated in my mobile and i have network access permission in my app android.permission.ACCESS_NETWORK_STATE 嗨,我正在使用Cordova / Ionic进行通知推送,我尝试获取设备的注册ID(我尝试使用我的手机和模拟器),问题是当准备好被称为SuccessHandler的设备返回成功“ Ok”但onNotificationGCM时没有被解雇,我的项目ID是正确的,并且在Google Cloud Console中激活了Android的Google Cloud Messaging,并且在我的移动设备中也激活了Internet,并且我的应用程序android.permission.ACCESS_NETWORK_STATE具有网络访问权限

THANKS 谢谢

This is going to sound very blind but it happened to me today, the plugin was working and all of the sudden it stopped working. 这听起来很盲目,但是今天发生在我身上,插件正在工作,突然间它停止工作。 Turns out my phones wifi was turned off. 原来我的手机的wifi已关闭。 For other people experiencing this issue. 对于其他遇到此问题的人。 The following steps should work. 以下步骤应该起作用。

If your phone has connectivity and is found the app should run on the phone and you will be able to get the registration id. 如果您的手机具有连接能力,并且发现该应用程序应在手机上运行,​​那么您将能够获取注册ID。

如果您像我一样使用Cordova 3.1,并且无法重建android项目,则可以尝试此处提到的解决方案, 在升级到cordova 3.1.0后,PushPlugin无法正常工作

I had the same symptoms but obviously a different problem. 我有相同的症状,但显然是不同的问题。

Check that your senderID ist actually your Google Project Number and not your Project ID . 检查您的senderID确实是您的Google Project编号,而不是您的Project ID It should only contain numbers. 它只能包含数字。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM