{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/715","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/715/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/715/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/715","id":141504971,"number":715,"title":"App crashes on notification when in background","user":{"login":"HanGmanXXL","id":14976917,"avatar_url":"https://avatars.githubusercontent.com/u/14976917?v=3","gravatar_id":"","url":"https://api.github.com/users/HanGmanXXL","html_url":"https://github.com/HanGmanXXL","followers_url":"https://api.github.com/users/HanGmanXXL/followers","following_url":"https://api.github.com/users/HanGmanXXL/following{/other_user}","gists_url":"https://api.github.com/users/HanGmanXXL/gists{/gist_id}","starred_url":"https://api.github.com/users/HanGmanXXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HanGmanXXL/subscriptions","organizations_url":"https://api.github.com/users/HanGmanXXL/orgs","repos_url":"https://api.github.com/users/HanGmanXXL/repos","events_url":"https://api.github.com/users/HanGmanXXL/events{/privacy}","received_events_url":"https://api.github.com/users/HanGmanXXL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/android","name":"android","color":"BFD4F2"},{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-17T07:46:47Z","updated_at":"2016-03-18T16:35:26Z","closed_at":null,"body":"### Actual Behaviour\r\nThe App crashes on notification, when in background. In App its all fine and works properly.\r\nReceiving notifications when app is in background worked already but at a moments notice it stopped working.\r\n\r\n#### Platform and Version\r\nAndroid 6.0.1 - Nexus 5x\r\nAndroid 5.1.1 - Sony Xperia Z3 Compact\r\n\r\nCordova v6.0.0\r\nPlugin v1.6.0\r\n\r\n#### Sample Push Data Payload\r\n```\r\n{\r\n  \"to\": my_id,\r\n  \"data\": {\r\n      \"message\": \"my message\",\r\n      \"title\": \"my title\"\r\n  }\r\n}\r\n```\r\n\r\n#### Sample Code that illustrates the problem\r\n```\r\ngcm = PushNotification.init({\r\n      'android': {\r\n        'senderID'           : my_sender_id,\r\n        'icon'               : '',\r\n        'iconColor'          : '',\r\n        'sound'              : true,\r\n        'vibrate'            : true,\r\n        'clearNotifications' : true,\r\n        'forceShow'          : false,\r\n        'topics'             : []\r\n      },\r\n      'ios': {\r\n        'alert'      : true,\r\n        'badge'      : true,\r\n        'sound'      : false,\r\n        'clearBadge' : false\r\n      },\r\n      windows: {}\r\n    });\r\n\r\ngcm.on('notification', function(data) {\r\n  alert(data.message);\r\n});\r\n```\r\n\r\nI don't know how to debug this kind of crash.\r\nThanks for your support!"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/198442904","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/715#issuecomment-198442904","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/715","id":198442904,"user":{"login":"wibimaster","id":626666,"avatar_url":"https://avatars.githubusercontent.com/u/626666?v=3","gravatar_id":"","url":"https://api.github.com/users/wibimaster","html_url":"https://github.com/wibimaster","followers_url":"https://api.github.com/users/wibimaster/followers","following_url":"https://api.github.com/users/wibimaster/following{/other_user}","gists_url":"https://api.github.com/users/wibimaster/gists{/gist_id}","starred_url":"https://api.github.com/users/wibimaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibimaster/subscriptions","organizations_url":"https://api.github.com/users/wibimaster/orgs","repos_url":"https://api.github.com/users/wibimaster/repos","events_url":"https://api.github.com/users/wibimaster/events{/privacy}","received_events_url":"https://api.github.com/users/wibimaster/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T16:35:26Z","updated_at":"2016-03-18T16:35:26Z","body":"I try many things, an example of init used (tried with \"iconColor: ''\" too):\r\n\r\n```\r\n            android: {\r\n                senderID: '123456789123',\r\n                icon: 'notification',\r\n                iconColor: 'purple',\r\n                sound: true,\r\n                vibrate: true,\r\n                clearNotifications: true,\r\n                forceShow: false,\r\n                topics: []\r\n            },\r\n            ios: {\r\n                senderID: '',\r\n                alert: false,\r\n                badge: false,\r\n                sound: false,\r\n                clearBadge: false,\r\n                gcmSandbox: false,\r\n                topics: [],\r\n                categories: {}\r\n            },\r\n            windows: {}\r\n```\r\n\r\nAnd same symptoms with all examples provided here, as this one (tried with a simple title + message notification too) :\r\n\r\n```\r\nvar service = new gcm.Sender(apiKey);\r\nvar message = new gcm.Message();\r\nmessage.addData('title', 'Test title');\r\nmessage.addData('message', 'Test message');\r\nmessage.addData('style', 'picture');\r\nmessage.addData('picture', 'http://36.media.tumblr.com/c066cc2238103856c9ac506faa6f3bc2/tumblr_nmstmqtuo81tssmyno1_1280.jpg');\r\nmessage.addData('summaryText', 'Test summary');\r\nmessage.addData('ledColor', [0,255,0,255]);\r\nservice.send(message, { registrationTokens: [ deviceID ] }, function (err, response) {\r\n    if(err) console.error(err);\r\n    else    console.log(response);\r\n});\r\n```"}}