首页 文章

在谷歌 Cloud 消息传递为Android

提问于
浏览
1

在我的Android应用程序中,我需要做推送通知,所以我搜索了那个,我在android指南找到了Google Cloud 消息,step by step procedure .

在编写Android应用程序时

第3步:编写my_app_package.GCMIntentService类

我需要创建从GCMBaseIntentService扩展的GCMIntentService类,我需要在GCMBaseIntentService和onRegistered方法中实现抽象方法(onRegistered,onUnregistered等),我应该将regid发送到您的服务器,以便它可以使用它向设备发送消息 .

我从here获得了Cordova GCM Push Notifications插件的Android示例

1)在那里我看到他们实现了GCMIntentService类(在src / com / cordova2 / gcm),在那个类中,看到onRegistered方法,在获取json后我不知道他们为什么在第39行调用GCMPlugin.sendJavascript(json)? .

2)如何使用Google Cloud 消息传递开发推送通知的客户端和服务器

1 回答

相关问题