【发布时间】:2012-11-08 05:20:19
【问题描述】:
在我的 android 应用程序中,我需要推送通知,所以我搜索了它,并在 android 指南 step by step procedure 上找到了 Google Cloud Messaging。
在编写 Android 应用程序时
第三步:编写 my_app_package.GCMIntentService 类
我需要创建从 GCMBaseIntentService 扩展的 GCMIntentService 类,我需要在 GCMBaseIntentService 和 onRegistered 方法中实现抽象方法(onRegistered、onUnregistered 等),我应该将 regid 发送到您的服务器,以便它可以使用它向设备发送消息.
我从here 获得了适用于 Android 的 Cordova GCM 推送通知插件示例
1)在那里我看到他们实现了 GCMIntentService 类(在 src/com/cordova2/gcm),在那个类中,看到 onRegistered 方法,在获取 json 之后我不知道他们为什么在调用 GCMPlugin.sendJavascript( json )第 39 行?。
2) 如何使用谷歌云消息来开发推送通知的客户端和服务器
【问题讨论】:
-
非常好的教程在这里tech-papers.org/…
标签: java android push-notification google-cloud-messaging sencha-touch