Worklight:App在前台时无法接收推送通知

时间:2015-12-13 19:11:59

标签: android ibm-mobilefirst

我有一个worklight应用程序,当它在前台时,它不会收到任何推送通知。它在后台工作正常。

我能看到的安卓日志是

12-14 00:35:35.304: V/GCMBroadcastReceiver(26076): onReceive: com.google.android.c2dm.intent.RECEIVE
12-14 00:35:35.304: V/GCMBroadcastReceiver(26076): GCM IntentService class: com.FinacleMobileApp.GCMIntentService
12-14 00:35:35.304: V/GCMBaseIntentService(26076): Acquiring wakelock
12-14 00:35:35.308: V/GCMBaseIntentService(26076): Intent service name: GCMIntentService-DynamicSenderIds-8
12-14 00:35:35.314: D/GCMIntentService(26076): GCMIntentService.onMessage in GCMIntentService.java:107 :: WLGCMIntentService: Received a message from the GCM server
12-14 00:35:35.315: V/GCMBaseIntentService(26076): Releasing wakelock
12-14 00:35:35.323: W/GCMIntentService(26076): GCMIntentService.onMessage in GCMIntentService.java:114 :: Unable to update badge while received push notification, becasue failed to parse badge number null, badge must be an integer number.
12-14 00:35:35.326: D/GCMIntentService(26076): GCMIntentService.addToIntentQueue in GCMIntentService.java:147 :: WLGCMIntentService: App is on foreground but init is not comeplete. Queue the intent for later re-sending when app is back on foreground.
12-14 00:35:35.328: D/push(26076): Push$1.onReceive in Push.java:91 :: Push: Queuing message for dispatch to javascript
12-14 00:36:04.067: D/CordovaActivity(26076): Paused the application!

任何人都可以告诉我,为什么会发生这种情况。

1 个答案:

答案 0 :(得分:0)

我首先要更正您在徽章上遇到的例外情况,以确保不会阻止它正常工作:

  

12-14 00:35:35.323:W / GCMIntentService(26076):GCMIntentService.java中的GCMIntentService.onMessage:114 ::收到推送通知时无法更新徽章,因为无法解析徽章编号null,徽章必须是整数。