{"action":"created","issue":{"url":"https://api.github.com/repos/intercom/intercom-cordova/issues/134","repository_url":"https://api.github.com/repos/intercom/intercom-cordova","labels_url":"https://api.github.com/repos/intercom/intercom-cordova/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/intercom/intercom-cordova/issues/134/comments","events_url":"https://api.github.com/repos/intercom/intercom-cordova/issues/134/events","html_url":"https://github.com/intercom/intercom-cordova/issues/134","id":201067128,"number":134,"title":"Android Push not working while app is closed (not background)","user":{"login":"Mohamed-Habshey","id":13639510,"avatar_url":"https://avatars.githubusercontent.com/u/13639510?v=3","gravatar_id":"","url":"https://api.github.com/users/Mohamed-Habshey","html_url":"https://github.com/Mohamed-Habshey","followers_url":"https://api.github.com/users/Mohamed-Habshey/followers","following_url":"https://api.github.com/users/Mohamed-Habshey/following{/other_user}","gists_url":"https://api.github.com/users/Mohamed-Habshey/gists{/gist_id}","starred_url":"https://api.github.com/users/Mohamed-Habshey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mohamed-Habshey/subscriptions","organizations_url":"https://api.github.com/users/Mohamed-Habshey/orgs","repos_url":"https://api.github.com/users/Mohamed-Habshey/repos","events_url":"https://api.github.com/users/Mohamed-Habshey/events{/privacy}","received_events_url":"https://api.github.com/users/Mohamed-Habshey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-16T16:38:59Z","updated_at":"2017-01-16T17:12:53Z","closed_at":null,"body":"Hi Everyone,\r\n\r\ni tried to get push notification to work with my ionic1 app via intercom, \r\nthe android app crash when i send a message while the app is closed however works fine if the app in the background, i even tried to debug the issue and used your simple app i got the same result.\r\nany ideas?\r\n\r\nThanks in advance\r\nRegards\r\nMohamed\r\n\r\n## Version info\r\n  - Intercom for Cordova/PhoneGap version: intercom@3.0.23, cordova 6.4.0, cordova-android@6.1.1\r\n  - iOS/Android OS version: android 4.2.2\r\n  - iOS/Android Device: emulator and real device SM-G900F\r\n\r\n## Expected behavior\r\n1. get a push message when app closed (not in the background)\r\n## Actual behavior\r\n1. app crash\r\n## Steps to reproduce\r\n 1. login to your app\r\n 2. make sure you closed the app not in the background\r\n 3. send message from intercom\r\n4. app crash\r\n\r\n## Logs\r\n\r\nadb logcat \r\n```\r\nW/dalvikvm( 6087): threadid=10: thread exiting with uncaught exception (group=0x5cca5b20)\r\nI/Process ( 6087): Sending signal. PID: 6087 SIG: 9\r\nD/BstCommandProcessor-Application( 1905): Application crash has been observed.\r\nW/BstCommandProcessor-Application( 1905): in sendHttpRequest, requestType is of CRASH_APP type but one of the requiredInfo is NULL, crashedApp = com.bluestacks.BstCommandProcessor.BstCrashedAppInfo@2e730208\r\nD/BstCommandProcessor-Application( 1905): in sendHttpRequest, request to send to (fqdn): http://10.0.2.2:2861/AppCrashedInfo\r\nD/BstCommandProcessor-Application( 1905): data: {\"packageName\":\"io.intercom.cordova.sample\",\"shortPackageName\":\"io.intercom.cordova.sample\",\"versionCode\":1,\"versionName\":\"0.0.1\"}\r\nD/AndroidRuntime( 6087): procName from cmdline: io.intercom.cordova.sample\r\nE/AndroidRuntime( 6087): in writeCrashedAppName, pkgName :io.intercom.cordova.sample\r\nD/AndroidRuntime( 6087): file written successfully with content: io.intercom.cordova.sample StringBuffer : ;io.intercom.cordova.sample\r\nE/AndroidRuntime( 6087): FATAL EXCEPTION: AsyncTask #1\r\nE/AndroidRuntime( 6087): Process: io.intercom.cordova.sample, PID: 6087\r\nE/AndroidRuntime( 6087): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()\r\nE/AndroidRuntime( 6087):        at android.os.Handler.<init>(Handler.java:200)\r\nE/AndroidRuntime( 6087):        at android.os.Handler.<init>(Handler.java:114)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.ResetManager.<init>(ResetManager.java:33)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.Injector.getResetManager(Injector.java:186)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.Injector.getLifecycleTracker(Injector.java:171)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.Injector.initWithAppCredentials(Injector.java:68)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.Injector.init(Injector.java:57)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.push.IntercomPushClient.handlePush(IntercomPushClient.java:92)\r\nE/AndroidRuntime( 6087):        at io.intercom.android.sdk.gcm.IntercomGcmListenerService.onMessageReceived(IntercomGcmListenerService.java:13)\r\nE/AndroidRuntime( 6087):        at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)\r\nE/AndroidRuntime( 6087):        at com.google.android.gms.gcm.GcmListenerService.zzn(Unknown Source)\r\nE/AndroidRuntime( 6087):        at com.google.android.gms.gcm.GcmListenerService.zzm(Unknown Source)\r\nE/AndroidRuntime( 6087):        at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)\r\nE/AndroidRuntime( 6087):        at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)\r\nE/AndroidRuntime( 6087):        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\nE/AndroidRuntime( 6087):        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\nE/AndroidRuntime( 6087):        at java.lang.Thread.run(Thread.java:841)\r\nI/ActivityManager( 1712): Process io.intercom.cordova.sample (pid 6087) has died.\r\n```"},"comment":{"url":"https://api.github.com/repos/intercom/intercom-cordova/issues/comments/272917837","html_url":"https://github.com/intercom/intercom-cordova/issues/134#issuecomment-272917837","issue_url":"https://api.github.com/repos/intercom/intercom-cordova/issues/134","id":272917837,"user":{"login":"Mohamed-Habshey","id":13639510,"avatar_url":"https://avatars.githubusercontent.com/u/13639510?v=3","gravatar_id":"","url":"https://api.github.com/users/Mohamed-Habshey","html_url":"https://github.com/Mohamed-Habshey","followers_url":"https://api.github.com/users/Mohamed-Habshey/followers","following_url":"https://api.github.com/users/Mohamed-Habshey/following{/other_user}","gists_url":"https://api.github.com/users/Mohamed-Habshey/gists{/gist_id}","starred_url":"https://api.github.com/users/Mohamed-Habshey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mohamed-Habshey/subscriptions","organizations_url":"https://api.github.com/users/Mohamed-Habshey/orgs","repos_url":"https://api.github.com/users/Mohamed-Habshey/repos","events_url":"https://api.github.com/users/Mohamed-Habshey/events{/privacy}","received_events_url":"https://api.github.com/users/Mohamed-Habshey/received_events","type":"User","site_admin":false},"created_at":"2017-01-16T17:12:53Z","updated_at":"2017-01-16T17:12:53Z","body":"update: actually this was fixed in intercom-android@3.0.18 \r\ni had upgraded and it worked fine i think this pr  #135  will solve the problem\r\nthanks 🙂 "}}
{"actor":{"display_login":"Mohamed-Habshey"}}