{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1150","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1150/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1150/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1150/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1150","id":169895291,"number":1150,"title":"sendResponse called twice","user":{"login":"cburghardt","id":839480,"avatar_url":"https://avatars.githubusercontent.com/u/839480?v=3","gravatar_id":"","url":"https://api.github.com/users/cburghardt","html_url":"https://github.com/cburghardt","followers_url":"https://api.github.com/users/cburghardt/followers","following_url":"https://api.github.com/users/cburghardt/following{/other_user}","gists_url":"https://api.github.com/users/cburghardt/gists{/gist_id}","starred_url":"https://api.github.com/users/cburghardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cburghardt/subscriptions","organizations_url":"https://api.github.com/users/cburghardt/orgs","repos_url":"https://api.github.com/users/cburghardt/repos","events_url":"https://api.github.com/users/cburghardt/events{/privacy}","received_events_url":"https://api.github.com/users/cburghardt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/ios","name":"ios","color":"BFD4F2"},{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-08-08T10:53:15Z","updated_at":"2016-08-10T15:34:21Z","closed_at":null,"body":"### Expected Behaviour\r\n\r\n### Actual Behavior\r\n\r\nPlugin crashes with the following stack trace:\r\n\r\n```\r\nFatal Exception: NSInternalInconsistencyException\r\nthis request has been neutered - you can't call -sendResponse: twice nor after encoding it\r\n\r\n3\r\nFoundation\t\r\n-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]\r\n4\tBaseBoard\t\r\n__40-[BSAction sendResponse:withCompletion:]_block_invoke\r\n5\r\nlibdispatch.dylib\t\r\n_dispatch_barrier_sync_f_invoke\r\n6\tBaseBoard\t\r\n-[BSAction sendResponse:withCompletion:]\r\n7\tUIKit\t\r\n-[UIHandleRemoteNotificationAction sendResponse:]\r\n8\tUIKit\t\r\n__91-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:]_block_invoke_32897\r\n```\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\n\r\niOS 9\r\n\r\n#### (Android) What device vendor (e.g. Samsung, HTC, Sony...)\r\n\r\n#### Cordova CLI version and cordova platform version\r\n\r\n    cordova --version                                    # e.g. 6.0.0\r\n6.3.0\r\n    cordova platform version android                     # e.g. 4.1.1\r\niOS 4.1.1\r\n\r\n#### Plugin version\r\n\r\n    cordova plugin version | grep phonegap-plugin-push   # e.g. 1.5.3\r\n1.7.4\r\n\r\n#### Sample Push Data Payload\r\n\r\n#### Sample Code that illustrates the problem\r\n\r\n```\r\n        pushNotification.on('notification', function (data) {\r\n            if (data.message && !isEmpty(data.message)) {\r\n                    if (!data.additionalData.foreground)\r\n                        pushNotification.finish();\r\n            }\r\n        });\r\n```\r\n\r\n#### Logs taken while reproducing problem"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/238905809","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/1150#issuecomment-238905809","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/1150","id":238905809,"user":{"login":"cburghardt","id":839480,"avatar_url":"https://avatars.githubusercontent.com/u/839480?v=3","gravatar_id":"","url":"https://api.github.com/users/cburghardt","html_url":"https://github.com/cburghardt","followers_url":"https://api.github.com/users/cburghardt/followers","following_url":"https://api.github.com/users/cburghardt/following{/other_user}","gists_url":"https://api.github.com/users/cburghardt/gists{/gist_id}","starred_url":"https://api.github.com/users/cburghardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cburghardt/subscriptions","organizations_url":"https://api.github.com/users/cburghardt/orgs","repos_url":"https://api.github.com/users/cburghardt/repos","events_url":"https://api.github.com/users/cburghardt/events{/privacy}","received_events_url":"https://api.github.com/users/cburghardt/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T15:34:21Z","updated_at":"2016-08-10T15:34:21Z","body":"OK and how do I set this notification ID in the payload so that it is recognized as key for the completion handler lookup? If that is already explained somewhere I apologize.\r\nAlso I just stumbled over AppDelegate+notification.m which already calls the completion handler in didReceiveRemoteNotification. So is the finish call actually necessary?"}}
{"actor":{"display_login":"cburghardt"}}