您好在我的项目中我添加了gcm通知服务并跟随开发者官方页面。我将设备注册ID发送到服务器我的密钥也保存在服务器中。我的服务器发送通知到gcm服务器那时服务器我获得成功消息。但是我没有得到任何推送通知到我的设备。请提供任何建议。提前致谢
并在我的logcat中显示此消息
GCMBroadcastReceiver: onReceive: com.google.android.c2dm.intent.RECEIVE
GCMBroadcastReceiver: GCM IntentService class: com.example.GCMIntentService
GCMBaseIntentService: Acquiring wakelock
this is my manifest with all other permissions
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
答案 0 :(得分:2)
我遇到了接收推送消息的相同问题,即使GCM服务器回复&#34;成功&#34;,因为wifi隐私。当我使用我的公司wifi时,我在移动设备上接收消息,因为它们被阻止了GCM服务器端口。所以,即使你的wifi也可能是其中一个原因。检查一次{此答案适用于其他人,可能面临此问题}
答案 1 :(得分:0)
您可以在登录gmail帐户时检查您的设备吗?
如果您未登录,则不会收到推送通知。
首先登录gmail然后尝试可能会有效。