-
Notifications
You must be signed in to change notification settings - Fork 1.9k
InstanceID.getToken() not called in an Intent #354
Comments
@alexislg2 thanks for the heads up and investigation. I was basing PushInstanceIDListenerService off a sample from Google that called the method directly. I'll make the change shortly. |
Great! I'm not sure if you know but if you want to test the receiver you can type where $PACKAGE_ID is the Android package name. You will have to add the |
I'll make a PR |
@alexislg2 have you done the work yet? If not this is on my list to get done today. |
yeah just wait a few seconds ;) |
Awesome, thanks @alexislg2. I've merged the PR and will do a point release sometime today. You saved me a couple hours of work to be sure. Open source folks, it's awesome. |
This thread has been automatically locked. |
Hey, I'm having a look at the PushInstanceIDListenerService.java file. And this line throw an exception on my logcat errors
phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java
Line 23 in 9522193
Error on logcat is
E PushPlugin_PushInstanceIDListenerService: at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)
According to the official documentation and to this SO post http://stackoverflow.com/questions/30577978/google-cloud-messaging-push-with-parse-and-android-client-does-not-work this line should be called in an Intent Do not call this method in the main thread; instead, use a service that extends IntentService.
This could explain why I never receive new tokens on my backend after token refresh.
this sample gives the right way to do it. What do you think?
https://github.com/googlesamples/google-services/blob/master/android/gcm/app/src/main/java/gcm/play/android/samples/com/gcmquickstart/MyInstanceIDListenerService.java
The text was updated successfully, but these errors were encountered: