Thanks for creating this awesome module. It is much appreciated.
My notifs are working fine when my app is in the background. When I close the app and try to receive a notification, on the device I get "Unfortunately, myapp has stopped."
In adb logcat, I see the following error:
E/AndroidRuntime(10364): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nl.vanvianen.android.gcm.GCMModule.isInForeground()' on a null object reference
E/AndroidRuntime(10364): at nl.vanvianen.android.gcm.GCMIntentService.onMessage(GCMIntentService.java:340)
E/AndroidRuntime(10364): at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:223)
E/AndroidRuntime(10364): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/AndroidRuntime(10364): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10364): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(10364): at android.os.HandlerThread.run(HandlerThread.java:61)
Looking more through the code, I would guess this has something to do with the fact that I have backgroundOnly set to true, which is making it do this check.
Hey,
Thanks for creating this awesome module. It is much appreciated.
My notifs are working fine when my app is in the background. When I close the app and try to receive a notification, on the device I get "Unfortunately, myapp has stopped."
In adb logcat, I see the following error:
E/AndroidRuntime(10364): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean nl.vanvianen.android.gcm.GCMModule.isInForeground()' on a null object reference E/AndroidRuntime(10364): at nl.vanvianen.android.gcm.GCMIntentService.onMessage(GCMIntentService.java:340) E/AndroidRuntime(10364): at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:223) E/AndroidRuntime(10364): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) E/AndroidRuntime(10364): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(10364): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(10364): at android.os.HandlerThread.run(HandlerThread.java:61)
Am I doing something incorrectly?
Any help is appreciated.