未调用 GCMIntentService 的 onRegisterd() 方法。
在日志中显示如下: onReceive:com.google.android.c2dm.intent.REGISTRATION GCM IntentService 类:com.example.dailysales.GCMIntentService 获取唤醒锁 我的 AndroidManifest.XML 文件代码如下:
<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.dailysales" />
</intent-filter>
</receiver>
<service android:name="com.example.dailysales.backgroundservice.InboxMessageLoadingService" >
</service>
<service
android:name=".GCMIntentService"
android:enabled="true" >
</service>
最佳答案
这个答案可能对您有帮助:https://stackoverflow.com/a/18598887/4195406
您正在使用来自 Google GCM 客户端库的 com.google.android.gcm.GCMBroadcastReceiver
广播接收器。此类希望 Intent 服务位于您应用的主包中。
您应该将 GCMIntentService
移动到应用的主包中,或者覆盖 GCMBroadcastReceiver
。
关于android - 未调用来自 GCMIntentService 的 onRegistered(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28584411/