用于离子的pushwoosh推送通知不适用于android

时间:2016-04-20 04:11:39

标签: android ionic-framework push-notification pushwoosh

我无法让Android Push与离子一起使用。 (ios顺便说一下)

我按照这里的文档:

http://docs.pushwoosh.com/docs/cordova-phonegap

我甚至试图基于此创建相同的示例应用程序:

https://www.youtube.com/watch?v=-P2O1jmb7fI

它在Android上不起作用(虽然可以使用ios)。

我配置了PushWoosh和应用程序,如下所示:

Application code: XXXXX-XXXXX (formatted hex appcode id)
google server key: 123456789012345678901234567890123456789 (39 hex key)
google project number: 123456789012 (mine has 12 digits)
GCM API is enabled 

我可以在PushWoosh中看到有Android设备注册,但为什么 我不能接受推动?我需要在手机上做些什么吗 代码等?我甚至尝试将断点放入addEventListener但没有收到任何内容。

真的需要Android才能使用推送通知。谢谢!

我正在使用设备:

Redmi Note 2
Android version 5.0.2 LRX22G

Didnt也适用于模拟器:

Android 5.0.2
Build number: sdk_google_phone_x86-eng 5.0.2 LSY66D 1797986test-keys

PushWoosh响应(当我为这些重新创建新密钥时会更新):

As far as I can see in your Push History, there are some "Unauthorized" errors. There are three possible scenarios why you are getting the "Unauthorized" error:

The Google Project number in your application isn't the one in Google Console;
The API key in your Control Panel isn't the same that you got in Google Console;
The API key, for some reason, doesn't work properly.
Could you please check whether your Google Project number and API key are fine?

Also, could you please try using the Browser Key instead of the Server Key and vice versa?

2 个答案:

答案 0 :(得分:0)

这是这类错误的正确答案。请确保您的Google Project Id与服务器密钥匹配。另外,请确保您没有在服务器密钥上设置任何限制或白色监听。

查看有关如何查找Google项目ID的文章:
https://support.google.com/cloud/answer/6158840?hl=en

答案 1 :(得分:0)

问题是我没有在正确的项目中启用GCM。始终假设主要项目api启用适用于所有人。