0
我使用GCM發送通知,一切工作正常。我試圖創建一個GCM庫,所以我可以很容易地將GCM整合到我未來的android應用程序中。我創建了一個項目,其中包含我需要顯示通知的所有內容,並將其標記爲庫。當我執行應用程序時,它會得到註冊ID,並且一切似乎都正常,但不會顯示通知。GCM獲取喚醒鎖
使用過濾器Tag:GCM
在LogCat
我得到如下:
04-29 15:24:33.937: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.REGISTRATION
04-29 15:24:33.937: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:33.937: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.195: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.195: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.195: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.242: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.242: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.242: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.320: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.320: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.320: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.398: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.398: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.398: V/GCMBaseIntentService(19334): Acquiring wakelock
04-29 15:24:44.453: V/GCMBroadcastReceiver(19334): onReceive: com.google.android.c2dm.intent.RECEIVE
04-29 15:24:44.460: V/GCMBroadcastReceiver(19334): GCM IntentService class: com.mobiblanc.slice.GCMIntentService
04-29 15:24:44.460: V/GCMBaseIntentService(19334): Acquiring wakelock
PS:當我在簡單的方式使用GCM,我在logcat中更多的線,如:釋放激活鎖定 感謝