{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/354","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/354/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/354/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/354","id":117638586,"number":354,"title":"InstanceID.getToken() not called in an Intent","user":{"login":"alexislg2","id":7933080,"avatar_url":"https://avatars.githubusercontent.com/u/7933080?v=3","gravatar_id":"","url":"https://api.github.com/users/alexislg2","html_url":"https://github.com/alexislg2","followers_url":"https://api.github.com/users/alexislg2/followers","following_url":"https://api.github.com/users/alexislg2/following{/other_user}","gists_url":"https://api.github.com/users/alexislg2/gists{/gist_id}","starred_url":"https://api.github.com/users/alexislg2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexislg2/subscriptions","organizations_url":"https://api.github.com/users/alexislg2/orgs","repos_url":"https://api.github.com/users/alexislg2/repos","events_url":"https://api.github.com/users/alexislg2/events{/privacy}","received_events_url":"https://api.github.com/users/alexislg2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-18T17:32:05Z","updated_at":"2015-11-19T15:48:55Z","closed_at":null,"body":"Hey, I'm having a look at the PushInstanceIDListenerService.java file. And this line throw an exception on my logcat errors \r\nhttps://github.com/phonegap/phonegap-plugin-push/blob/95221931f1fc87398d38a3cc2c61b338a1d60e4d/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java#L23\r\n\r\nError on logcat is `E PushPlugin_PushInstanceIDListenerService:  at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)`\r\n\r\nAccording 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.**\r\n\r\nThis could explain why I never receive new tokens on my backend after token refresh.\r\n\r\nthis sample gives the right way to do it. What do you think?\r\nhttps://github.com/googlesamples/google-services/blob/master/android/gcm/app/src/main/java/gcm/play/android/samples/com/gcmquickstart/MyInstanceIDListenerService.java"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/158097012","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/354#issuecomment-158097012","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/354","id":158097012,"user":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T15:48:55Z","updated_at":"2015-11-19T15:48:55Z","body":"@alexislg2 have you done the work yet? If not this is on my list to get done today."}}