{"action":"created","issue":{"url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/26","labels_url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/26/comments","events_url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/26/events","html_url":"https://github.com/Telerik-Verified-Plugins/PushNotification/issues/26","id":71275571,"number":26,"title":"No alert popup when in app","user":{"login":"roberthh","id":12136756,"avatar_url":"https://avatars.githubusercontent.com/u/12136756?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthh","html_url":"https://github.com/roberthh","followers_url":"https://api.github.com/users/roberthh/followers","following_url":"https://api.github.com/users/roberthh/following{/other_user}","gists_url":"https://api.github.com/users/roberthh/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthh/subscriptions","organizations_url":"https://api.github.com/users/roberthh/orgs","repos_url":"https://api.github.com/users/roberthh/repos","events_url":"https://api.github.com/users/roberthh/events{/privacy}","received_events_url":"https://api.github.com/users/roberthh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-27T12:53:59Z","updated_at":"2015-04-27T13:11:46Z","closed_at":null,"body":"When app is in foreground and I send a notification, then I did not get an alert in app.\r\n\r\nI just see in Xcode log that the notification is somehow recognized:\r\n2015-04-27 14:45:05.392 XYZ[3188:413524] didReceiveNotification\r\n2015-04-27 14:45:05.393 XYZ[3188:413524] Notification received\r\n2015-04-27 14:45:05.395 XYZ[3188:413524] Msg: {\"alert\":\"Hello World\",\"badge\":\"2\",\"sound\":\"assets/beep.wav\",foreground:\"1\"}\r\n\r\nBut nothing else happens. No alert popup in app or something.\r\n\r\nSeems that Javascript function \"onNotificationAPN\" is not called.\r\n\r\nAny ideas?\r\n\r\nThanks,\r\nRobert\r\n\r\nXcode 6.4 / iOS 8.3 / iPhone 5S"},"comment":{"url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/comments/96645017","html_url":"https://github.com/Telerik-Verified-Plugins/PushNotification/issues/26#issuecomment-96645017","issue_url":"https://api.github.com/repos/Telerik-Verified-Plugins/PushNotification/issues/26","id":96645017,"user":{"login":"AntonDobrev","id":3618710,"avatar_url":"https://avatars.githubusercontent.com/u/3618710?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonDobrev","html_url":"https://github.com/AntonDobrev","followers_url":"https://api.github.com/users/AntonDobrev/followers","following_url":"https://api.github.com/users/AntonDobrev/following{/other_user}","gists_url":"https://api.github.com/users/AntonDobrev/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonDobrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonDobrev/subscriptions","organizations_url":"https://api.github.com/users/AntonDobrev/orgs","repos_url":"https://api.github.com/users/AntonDobrev/repos","events_url":"https://api.github.com/users/AntonDobrev/events{/privacy}","received_events_url":"https://api.github.com/users/AntonDobrev/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T13:11:46Z","updated_at":"2015-04-27T13:11:46Z","body":"Hello Robert,\r\n\r\nBased on the log in the console it appears that the event is correctly received, but perhaps there is no registered handler. In this case the app should execute the logic in \"onNotificatioAPN\".\r\n\r\nWhat I'd suggest here is to make sure that you are calling the `register` method of the plugin when the app starts. Thus you will be sure that the JS callback is supplied to the native code. For example - the app is coldstarted through a notification - call `register`, for example, in the device ready event handler, and the logic in \"onNotificatioAPN\" should be executed immediately. \r\n\r\nAnother check I'd suggest is to verify that \"onNotificatioAPN\" is available in this scope. "}}