{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/2551","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/2551/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/2551/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/2551/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/2551","id":360923190,"node_id":"MDU6SXNzdWUzNjA5MjMxOTA=","number":2551,"title":"Notification in background doesn't open an app","user":{"login":"d-mh","id":23344781,"node_id":"MDQ6VXNlcjIzMzQ0Nzgx","avatar_url":"https://avatars0.githubusercontent.com/u/23344781?v=4","gravatar_id":"","url":"https://api.github.com/users/d-mh","html_url":"https://github.com/d-mh","followers_url":"https://api.github.com/users/d-mh/followers","following_url":"https://api.github.com/users/d-mh/following{/other_user}","gists_url":"https://api.github.com/users/d-mh/gists{/gist_id}","starred_url":"https://api.github.com/users/d-mh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-mh/subscriptions","organizations_url":"https://api.github.com/users/d-mh/orgs","repos_url":"https://api.github.com/users/d-mh/repos","events_url":"https://api.github.com/users/d-mh/events{/privacy}","received_events_url":"https://api.github.com/users/d-mh/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":196374009,"node_id":"MDU6TGFiZWwxOTYzNzQwMDk=","url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-17T15:28:20Z","updated_at":"2018-10-18T09:39:57Z","closed_at":"2018-09-18T08:53:34Z","author_association":"NONE","body":"### Expected Behaviour\r\nClicking on notification should open an app and call on('notification') event. I would like to wait for user to click for notification, then app is opening and on('notification') event is triggered.  I don't want to use content-available options.\r\n\r\n### Actual Behaviour\r\nWhen app is closed or is in background I am receiving notification in status bar, after clicking on it nothing happens - app is not opened. In foreground mode where app is open I am receiving notification with data successfully. \r\n\r\n#### Steps to Reproduce \r\n\r\nLaunch mode in AndroidManifest.xml: android:launchMode=\"singleTop\" \r\n\r\nI tried with \"notification\": {\"title\": \"title\", \"body\":\"body\"} payload - it opened an app, but on('notification') event was not triggered. \r\n\r\n\r\n#### Cordova CLI version and cordova platform version\r\n\r\n    cordova --version                                    8.0.0\r\n    cordova platform version android                     7.1.0\r\n\r\n#### Plugin version\r\n\r\n    cordova plugin version | grep phonegap-plugin-push   2.2.3\r\n\r\n#### Sample Push Data Payload\r\n{\r\n  \"payload\": {\r\n    \"services\": {\r\n      \"apns\": {\r\n        \"aps\": {\r\n          \"alert\": {\r\n            \"title\": \"Test notification for DM\",\r\n            \"body\": \"Test notification for DM\"\r\n          },\r\n          \"badge\": 1,\r\n          \"sound\": \"default\"\r\n        },\r\n        \"queryParams\": {},\r\n        \"title\": \"Test notification for DM\",\r\n        \"body\": \"Test notification for DM\",\r\n        \"entityName\": \"contacts\",\r\n        \"entityID\": \"300000007365680\"\r\n      },\r\n      \"fcm\": {\r\n        \"data\": {\r\n          \"queryParams\": {},\r\n          \"title\": \"Test notification for DM\",\r\n          \"message\": \"Test notification for DM\",\r\n          \"entityName\": \"contacts\",\r\n          \"entityID\": \"300000007365680\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n\r\n\r\n#### Logs taken while reproducing problem\r\n\r\nWHEN IN BACKGROUND - APP IS NOT OPENED\r\n\r\nV/Push_Plugin(24292): execute: action=init\r\nV/Push_Plugin(24292): execute: data=[{\"android\":{\"icon\":\"fapp-icon\",\"iconColor\":\"#FF0000\"}}]\r\nV/Push_Plugin(24292): execute: jo={\"icon\":\"fapp-icon\",\"iconColor\":\"#FF0000\"}\r\nV/Push_Plugin(24292): execute: senderID=292929820186\r\nV/Push_Plugin(24292): onRegistered: {\"registrationId\":\"reg id here\",\"registrationType\":\"FCM\"}\r\nD/Push_FCMService(24292): onMessage - from: 292929820186\r\nD/Push_FCMService(24292): sender id = 292929820186\r\nD/Push_FCMService(24292): normalize extras\r\nD/Push_FCMService(24292): key = entityID\r\nD/Push_FCMService(24292): replace key entityID with entityID\r\nD/Push_FCMService(24292): key = entityName\r\nD/Push_FCMService(24292): replace key entityName with entityName\r\nD/Push_FCMService(24292): key = queryParams\r\nD/Push_FCMService(24292): replace key queryParams with queryParams\r\nD/Push_FCMService(24292): key = notId\r\nD/Push_FCMService(24292): replace key notId with notId\r\nD/Push_FCMService(24292): key = title\r\nD/Push_FCMService(24292): replace key title with title\r\nD/Push_FCMService(24292): no locale found for key = title, error Value Test of type java.lang.String cannot be converted to JSONObject\r\nD/Push_FCMService(24292): key = message\r\nD/Push_FCMService(24292): replace key message with message\r\nD/Push_FCMService(24292): no locale found for key = message, error Value Test of type java.lang.String cannot be converted to JSONObject\r\nD/Push_FCMService(24292): background\r\nD/Push_FCMService(24292): message =[Test notification for DM]\r\nD/Push_FCMService(24292): title =[Test notification for DM]\r\nD/Push_FCMService(24292): contentAvailable =[null]\r\nD/Push_FCMService(24292): forceStart =[null]\r\nD/Push_FCMService(24292): create notification\r\nD/Push_FCMService(24292): stored icon=fapp-icon\r\nD/Push_FCMService(24292): stored iconColor=#FF0000\r\nD/Push_FCMService(24292): stored sound=true\r\nD/Push_FCMService(24292): stored vibrate=true\r\nD/Push_FCMService(24292): using icon from plugin options\r\nD/Push_FCMService(24292): no icon resource found - using application icon\r\nD/Push_FCMService(24292): create actions: with in-line\r\nI/ActivityManager(  816): START u0 {flg=0x24000000 cmp=com.fapp.fappapp/com.adobe.phonegap.push.PushHandlerActivity (has extras)} from uid 10234 on display 0\r\n\r\n\r\nWHEN IN FOREGROUND - WORKING\r\n\r\nD/Push_FCMService(24292): onMessage - from: 292929820186\r\nD/Push_FCMService(24292): sender id = 292929820186\r\nD/Push_FCMService(24292): normalize extras\r\nD/Push_FCMService(24292): key = entityID\r\nD/Push_FCMService(24292): replace key entityID with entityID\r\nD/Push_FCMService(24292): key = entityName\r\nD/Push_FCMService(24292): replace key entityName with entityName\r\nD/Push_FCMService(24292): key = queryParams\r\nD/Push_FCMService(24292): replace key queryParams with queryParams\r\nD/Push_FCMService(24292): key = notId\r\nD/Push_FCMService(24292): replace key notId with notId\r\nD/Push_FCMService(24292): key = title\r\nD/Push_FCMService(24292): replace key title with title\r\nD/Push_FCMService(24292): no locale found for key = title, error Value Test of type java.lang.String cannot be converted to JSONObject\r\nD/Push_FCMService(24292): key = message\r\nD/Push_FCMService(24292): replace key message with message\r\nD/Push_FCMService(24292): no locale found for key = message, error Value Test of type java.lang.String cannot be converted to JSONObject\r\nD/Push_FCMService(24292): foreground\r\nD/Push_Plugin(24292): convert extras to json\r\nD/Push_Plugin(24292): key = entityID\r\nD/Push_Plugin(24292): key = entityName\r\nD/Push_Plugin(24292): key = queryParams\r\nD/Push_Plugin(24292): key = notId\r\nD/Push_Plugin(24292): key = title\r\nD/Push_Plugin(24292): key = message\r\nD/Push_Plugin(24292): key = coldstart\r\nD/Push_Plugin(24292): key = foreground\r\nV/Push_Plugin(24292): extrasToJSON: {\"title\":\"Test notification for DM\",\"message\":\"Test notification for DM\",\"additionalData\":{\"entityID\":\"300000007365680\",\"entityName\":\"contacts\",\"queryParams\":{},\"notId\":\"10\",\"coldstart\":false,\"foreground\":true}}\r\n\r\n\r\nV/Push_Plugin(24292): execute: action=setApplicationIconBadgeNumber\r\nV/Push_Plugin(24292): setApplicationIconBadgeNumber: data=[{\"badge\":0}]"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/430943938","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/2551#issuecomment-430943938","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/2551","id":430943938,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDk0MzkzOA==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-10-18T09:39:57Z","updated_at":"2018-10-18T09:39:57Z","author_association":"NONE","body":"This thread has been automatically locked."}}
{"actor":{"display_login":"lock"}}