草庐IT

android - GCM 推送通知图标

在GCM的官方文档中here他们提到如何通过这个例子为推送通知放置一个图标{"to":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...","notification":{"body":"greatmatch!","title":"Portugalvs.Denmark","icon":"myicon"}}我的问题是“myicon”是图标的名称,它存在于何处?例如:我在androidstudio的项目中有可绘制的“myicon.png”?或者它在哪里?请有人解释并提前致谢 最佳答案 使用dra

android - 当应用程序关闭或应用程序处于后台时获得两次 GCM PUSH 通知

我已经在我的应用程序中实现了gcm推送通知。一切正常,我也收到通知。问题:当应用处于后台或终止状态时,我一次收到2条通知。当应用程序处于前台时,我只收到1条通知。Appshouldgetonly1notificationasrequirementbutunfortunatelyfacingundefinedsituation.我的代码如下:GCMPushReceiverService接收消息的类。publicclassGCMPushReceiverServiceextendsGcmListenerService{//Thismethodwillbecalledoneverynewmes

android - GCM 和特殊字符

我最近将我的c2dmpushaaplucation更改为GCM。新的问题出现了。它现在接收'?'而不是'ö','ï',...我的服务器记录正确的字符串,但应用程序收到“?”相反。您认为它可能与GCM有关吗?我的代码如下:publicstaticvoiddisplayMessage(Contextcontext,Intentintent){Bundleextras=intent.getExtras();if(extras!=null){Stringmessage=(String)extras.get("message");Log.v("extras",extras.toString())

android - Google Cloud Messaging (GCM) 和 registration_id 过期了,我怎么知道?

我组装了一个骨架客户端/服务器GCM应用程序,它从我的粗糙且准备好的服务器上接受消息并在我的Android手机上显示消息。我说“骨架”和“粗略且准备就绪”是因为我的应用程序的registration_id被硬编码到服务器端,作为我在启动示例Android应用程序并在GCM服务器上注册应用程序/设备组合时在调试器中捕获的值。当我开始思考时,我正要开始为双方提供一种读/写机制来访问服务器上的一个简单数据库来存储reg_id/device组合:我知道这个reg_id可以随时过期,因为谷歌说它可以。从文档中可以清楚地看出如何检查id是否仍然正常,如果,如果很大,我再次启动应用程序。但是,我或任

Android NEW GCM PUSH(使用 Google Play 服务)

有没有人成功将GCM消息[UsingGooglePlayServices]推送到您的设备?这个新的gcm真的让我很烦,我研究了大约10天,除了https://code.google.com/p/gcm/source/browse/#git%2Fgcm-client%2Fsrc%2Fcom%2Fgoogle%2Fandroid%2Fgcm%2Fdemo%2Fapp这可以帮助我进行最新的gcm推送。我浏览了所有可以打开的教程,它们都在不断讲述C2DM(与GCMRegistrar)我认为这个GCMPush是在2013年8月发布的,这就是为什么当我试图寻找它的教程时它真的很痛苦原来如此,请帮忙

android - phonegap android 注册 gcm

我是phonegap的新手,正在尝试为android开发一个应用程序以使其在GCM中注册。我已经在谷歌API中设置了项目。我正在按照PushPlugin中的步骤进行操作。尽管我无法获取设备的注册ID,但我已经设法让代码运行。我正在模拟器上进行测试。我的index.html代码:com.PhoneGap.c2dm-->varpushNotification;functiononDeviceReady(){$("#app-status-ul").append('devicereadyeventreceived');document.addEventListener("backbutton"

android - 每个支持 GCM 的应用程序都应该有 "android.permission.WAKE_LOCK"

我见过的所有支持GCM的应用程序都有android.permission.WAKE_LOCK我想知道这背后的原因。如果支持GCM的应用没有此权限会怎样? 最佳答案 根据Google文档,它是可选的:Theandroid.permission.WAKE_LOCKpermissionsotheapplicationcankeeptheprocessorfromsleepingwhenamessageisreceived.Optional—useonlyiftheappwantstokeepthedevicefromsleeping.来源

android - 错误 = TooManyMessages GCM

我开始实现GCM。我正在使用officialtutorialbyGoogle.我在Google上没有发现任何关于此错误的信息。有人知道这是什么意思吗?我从BroadcastReceiver得到它:if(GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)){sendNotification("Senderror:"+intent.getExtras().toString());Log.i(TAG,"Senderror:"+intent.getExtras().toString());07-1116:56:55.

android - GCM Google 服务器以空消息响应

我正在关注this链接,但在向GCMAPI发送消息后,我的Android收到一条空消息(值设置为null)。这是我的DjangoView,正在向GCMAPI发送消息:@csrf_exemptdefsend_notification(request):message={"name":"Kousik","email":"kousik.tict@gmail.com"}registration_ids=['xxxxxxxxxxxxxxx','xxxxxxxxxxxxxxxxxx']post_data={"data":message,"registration_ids":registration

android - gcm GoogleCloudMessaging 新实现

我尝试从gcm.jar更新以从google-play-services.jar获取GCM。我使用与所示相同的代码here.我使用的是与更改客户端实现之前相同的服务器(node-gcm)。我得到了registrationId,但是当我尝试发送通知时,没有调用GcmBroadcastReceiver.onReceive。(我在list文件中有它)importandroid.app.Activity;importandroid.content.ComponentName;importandroid.content.Context;importandroid.content.Intent;im