Appcelerator 钛 Android 推送通知 GCM 失败? [英] Appcelerator titanium Android push notification GCM failure?

查看:27
本文介绍了Appcelerator 钛 Android 推送通知 GCM 失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Appcelerator studio 的新项目中为 Android 和 IOS 设置了推送通知,IOS 工作正常,但 android 没有,我的问题是成功获取并注册了 android 设备令牌,但是当我从 Appcelerator 发送推送时Android 失败时工作室 IOS 成功.

i've setup push notification for Android and IOS in new project in Appcelerator studio , the IOS working fine , but the android not , my issue is the android devices token is successfully taken and registered but when i send a push from Appcelerator studio IOS success when Android failed.

我已在 google 开发者控制台中启用此 API.

I've enabled this API's in google developer console .

并创建 API 密钥:

and created API key :

我在 Appcelerator ASC 中使用了 API 密钥:

and i used the API key in Appcelerator ASC :

我不明白为什么我可以获取 Android 设备令牌,但我无法发送推送通知?

i don't understand why i can take the Android device token but i am not able to send push notification ?

推荐答案

我找到了appcelerator文档还没有更新的解决方案

i found the solution the document of appcelerator is not updated yet

所以这里你必须做的

尝试使用以下示例代码进行设备注册:

try the following sample code for devices registration :

https://gist.github.com/MotiurRahman/68bb7aad307901805b5f

然后为 Android 设备配置推送服务:

Then Configuring push services for Android devices :

http://docs.appcelerator.com/platform/latest/#!/guide/Configuring_push_services-section-37551713_Configuringpushservices-ConfiguringpushservicesforAndroiddevices

使用 Firebase WEB API KEY和项目 ID

With Firebase WEB API KEY and project ID

https://console.firebase.google.com/?pli=1

从 JSON 文件和 Web API KEY(作为 GCM API 密钥)获取 project_number(作为 Sender ID)从您的 Firebase 控制台.现在配置您的仪表板以进行推送通知

Get project_number (as Sender ID ) from JSON file and Web API KEY( as GCM API key ) from your firebase console.Now configure your dashboard for push notification

http://docs.appcelerator.com/platform/latest/#!/guide/Sending_and_Scheduling_Push_Notifications

这篇关于Appcelerator 钛 Android 推送通知 GCM 失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆