{"action":"created","issue":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/675","labels_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/675/labels{/name}","comments_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/675/comments","events_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/675/events","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/675","id":106812569,"number":675,"title":"Not receiving local notification when user clicks on banner and app is killed","user":{"login":"jim0020","id":833366,"avatar_url":"https://avatars.githubusercontent.com/u/833366?v=3","gravatar_id":"","url":"https://api.github.com/users/jim0020","html_url":"https://github.com/jim0020","followers_url":"https://api.github.com/users/jim0020/followers","following_url":"https://api.github.com/users/jim0020/following{/other_user}","gists_url":"https://api.github.com/users/jim0020/gists{/gist_id}","starred_url":"https://api.github.com/users/jim0020/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim0020/subscriptions","organizations_url":"https://api.github.com/users/jim0020/orgs","repos_url":"https://api.github.com/users/jim0020/repos","events_url":"https://api.github.com/users/jim0020/events{/privacy}","received_events_url":"https://api.github.com/users/jim0020/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/labels/android","name":"android","color":"fad8c7"},{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/labels/inexplicable","name":"inexplicable","color":"eb6420"},{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/labels/ios","name":"ios","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":{"login":"katzer","id":2039384,"avatar_url":"https://avatars.githubusercontent.com/u/2039384?v=3","gravatar_id":"","url":"https://api.github.com/users/katzer","html_url":"https://github.com/katzer","followers_url":"https://api.github.com/users/katzer/followers","following_url":"https://api.github.com/users/katzer/following{/other_user}","gists_url":"https://api.github.com/users/katzer/gists{/gist_id}","starred_url":"https://api.github.com/users/katzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzer/subscriptions","organizations_url":"https://api.github.com/users/katzer/orgs","repos_url":"https://api.github.com/users/katzer/repos","events_url":"https://api.github.com/users/katzer/events{/privacy}","received_events_url":"https://api.github.com/users/katzer/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-09-16T16:41:35Z","updated_at":"2015-12-09T14:34:13Z","closed_at":"2015-12-09T14:34:13Z","body":"I launch my iOS app, and the local notifications are created.  Then the app is killed (not in background, not in foreground, that is I swiped up on the app from the double click home button app list). When a local notification is then triggered, and I click on the notification banner, the app launches but neither the \"click\" event nor the \"trigger\" event is called.\r\n\r\nIf the app is in the background it works fine.\r\n\r\nWhat might I be missing?   Anyone else seen this?\r\n\r\nI suspect the html document, and thus the local notification plugin, is not ready when the notification is processed.\r\n\r\nI haven't tried this yet on Android."},"comment":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/comments/163264392","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/675#issuecomment-163264392","issue_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/675","id":163264392,"user":{"login":"katzer","id":2039384,"avatar_url":"https://avatars.githubusercontent.com/u/2039384?v=3","gravatar_id":"","url":"https://api.github.com/users/katzer","html_url":"https://github.com/katzer","followers_url":"https://api.github.com/users/katzer/followers","following_url":"https://api.github.com/users/katzer/following{/other_user}","gists_url":"https://api.github.com/users/katzer/gists{/gist_id}","starred_url":"https://api.github.com/users/katzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katzer/subscriptions","organizations_url":"https://api.github.com/users/katzer/orgs","repos_url":"https://api.github.com/users/katzer/repos","events_url":"https://api.github.com/users/katzer/events{/privacy}","received_events_url":"https://api.github.com/users/katzer/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T14:34:13Z","updated_at":"2015-12-09T14:34:13Z","body":"@jim0020 \r\n@Tawpie\r\n\r\nI tried extra tried out all possible ways on iOS and Android and each time the `click` callback was fired. If you try it with the Kitchen Sink App, does it work?\r\n\r\nThe interesting JS code can be found in `local-notification-util.js`. Make sure that you register the callbacks as soon as possible and not within a thread.\r\n```js\r\n// Called after 'deviceready' event\r\nchannel.deviceready.subscribe(function () {\r\n    // Device is ready now, the listeners are registered\r\n    // and all queued events can be executed.\r\n    exec(null, null, 'LocalNotification', 'deviceready', []);\r\n});\r\n```"}}