2014-10-28 80 views
0

我也跟着全部来自“http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/”我成功注册我的模拟器[5554]但是在教程中陈述不能接收我的本地服务器的所有通知。我错过了什么?我使用vertrigo作为我的后端数据库。谷歌云消息没有推送通知接收到我的设备

使用此:

<uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="16" /> 

我的模拟器:

google APIs 19 

请帮助。

回答

0

可能有多种情况。你需要调试你的应用程序。

  1. 发送推送通知
  2. 现在去日食,点击logcat的
  3. 然后转到“详细信息”。
  4. 然后使用GCM从服务器向设备发送消息。
  5. 之后,快速进入logcat屏幕。
  6. 现在详细屏幕将会快速移动。复制所有文本,然后将其粘贴到记事本中。
  7. 在这里你可以看到天气广播接收机是否成功实施或没有。广播接收机接收系统广播通知。在GCM消息到来时,android操作系统宣布它已收到来自服务器的消息。因此,应用程序的广播接收器会收到消息并将该消息传递给您的应用程序。

如果GCM消息到达设备,但存在过错广播接收器,然后你会看到错误,如下面给出。参考:Android GCM push notification教程。

 12-27 22:55:58.691: D/STATUSBAR-SignalClusterView(450): 
     mSeparateMobileGroup=8 
     12-27 22:55:59.691: D/STATUSBAR-NetworkController(450): refreshSignalCluster: data=-1 bt=false 
     12-27 22:55:59.691: D/STATUSBAR-SignalClusterView(450): mSeparateMobileGroup=8 
     12-27 22:55:59.699: D/STATUSBAR-SignalClusterView(450): mSeparateMobileGroup=8 
     12-27 22:55:59.699: D/STATUSBAR-SignalClusterView(450): mSeparateMobileGroup=8 
     12-27 22:55:59.808: W/AlarmManager(357): FACTORY_ON= 0 
     12-27 22:55:59.863: W/GTalkService(22378): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { 
     act=com.google.android.c2dm.intent.RECEIVE pkg=com.techlovejump.gcm 
    (has extras) } 
     12-27 22:55:59.863: W/GTalkService(22378): Receiver package not found, unregister application com.techlovejump.gcm sender 
    538861816112 
     12-27 22:55:59.886: W/GCM(22378): DIR: /data/data/com.google.android.gms/app_APP 
     /data/data/com.google.android.gsf 
     12-27 22:55:59.996: V/AlarmManager(357): waitForAlarm result :8 
     12-27 22:55:59.996: V/AlarmManager(357): ClockReceiver onReceive() ACTION_TIME_TICK 
     12-27 22:55:59.996: W/AlarmManager(357): FACTORY_ON= 0 
     12-27 22:56:00.003: D/STATUSBAR-Clock(450): onReceive() - ACTION_TIME_TICK 

如果您没有在详细信息中看到GCM消息的任何日志,那么来自GCM的消息尚未在您的设备上收到。在GCM上注册设备或从服务器发送消息时存在一些问题。

+0

谢谢你回答我的问题先生。从本地服务器发送推送时,我的logcat上没有列出任何内容。我该怎么做才能解决这个问题。我成功注册了我的仿真器设备。 – 2014-10-28 23:43:38

相关问题