{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1774","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1774/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1774/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1774/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1774","id":234549354,"node_id":"MDU6SXNzdWUyMzQ1NDkzNTQ=","number":1774,"title":"Android - On notification event not triggered when the app is running in background","user":{"login":"eddyDEVDE","id":29091926,"node_id":"MDQ6VXNlcjI5MDkxOTI2","avatar_url":"https://avatars3.githubusercontent.com/u/29091926?v=4","gravatar_id":"","url":"https://api.github.com/users/eddyDEVDE","html_url":"https://github.com/eddyDEVDE","followers_url":"https://api.github.com/users/eddyDEVDE/followers","following_url":"https://api.github.com/users/eddyDEVDE/following{/other_user}","gists_url":"https://api.github.com/users/eddyDEVDE/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyDEVDE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyDEVDE/subscriptions","organizations_url":"https://api.github.com/users/eddyDEVDE/orgs","repos_url":"https://api.github.com/users/eddyDEVDE/repos","events_url":"https://api.github.com/users/eddyDEVDE/events{/privacy}","received_events_url":"https://api.github.com/users/eddyDEVDE/received_events","type":"User","site_admin":false},"labels":[{"id":307723242,"node_id":"MDU6TGFiZWwzMDc3MjMyNDI=","url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/android","name":"android","color":"BFD4F2","default":false},{"id":226278764,"node_id":"MDU6TGFiZWwyMjYyNzg3NjQ=","url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/docs","name":"docs","color":"FEF2C0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2017-06-08T14:36:57Z","updated_at":"2018-06-03T02:48:21Z","closed_at":null,"author_association":"NONE","body":"When my app is running in background on Android, the on notification function isn't triggered when the notification is opened. I read something about sending ` \"content-available\": \"1\"`, but this still isn't clear.\r\n\r\n### Expected Behaviour\r\nTo registrate the on registration function.\r\n\r\n### Actual Behaviour\r\nIt doesn't registrate the function\r\n\r\n### Reproduce Scenario (including but not limited to)\r\n\r\n#### Steps to Reproduce \r\n\r\n#### Platform and Version (eg. Android 5.0 or iOS 9.2.1)\r\nAndroid\r\n\r\n#### (Android) What device vendor (e.g. Samsung, HTC, Sony...)\r\nSamsung\r\n\r\n#### Cordova CLI version and cordova platform version\r\n\r\n\r\n    cordova --version                                    6.5.0\r\n    cordova platform version android          android 6.2.2\r\n\r\n#### Plugin version\r\n\r\n    cordova plugin version | grep phonegap-plugin-push   1.10.4 \"PushPlugin\"\r\n\r\n#### Sample Push Data Payload\r\nThis is the GCM code from the backend\r\n\r\n```\r\nlet message = new gcm.Message({\r\n                data: { \r\n                    \"data\": 'someData',\r\n                    \"content-available\": \"1\",\r\n                },\r\n                notification: {\r\n                    title: \"Title notification\",\r\n                    body: \"Body notification\",\r\n                    icon: 'ic_launcher'\r\n                }\r\n            });\r\n          sender.send(message, { registrationTokens: registrationIds }, function (err, response) {// Err handling });\r\n```\r\n\r\n#### Sample Code that illustrates the problem\r\n\r\n```\r\npush.on('registration', (data) => {\r\n                       // Send to backend\r\n                    });\r\n\r\n                    push.on('notification', (data) => {\r\n                        console.log(\"Notification received\", JSON.stringify(data));\r\n\r\n                        this.nav.push(SomeComponent, {data: data.additiionalData.data});\r\n                        push.finish(function() {\r\n                            console.log(\"Finished push\");\r\n                        }, function(){\r\n                            console.log(\"Something went wrong\");\r\n                        });\r\n                        \r\n                    });\r\n                    push.on('error', (e) => {\r\n                        console.log(\"Error\", e);\r\n                        console.log(e.message);\r\n                    });\r\n```\r\n\r\n#### Logs taken while reproducing problem\r\n"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/394131047","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1774#issuecomment-394131047","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1774","id":394131047,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDEzMTA0Nw==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-06-03T02:48:21Z","updated_at":"2018-06-03T02:48:21Z","author_association":"NONE","body":"This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n"}}
{"actor":{"display_login":"stale"}}