{"action":"opened","issue":{"url":"https://api.github.com/repos/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/141","labels_url":"https://api.github.com/repos/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/141/comments","events_url":"https://api.github.com/repos/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/141/events","html_url":"https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/141","id":119940225,"number":141,"title":"registerDevice callbacks aren't called when push notifications are disabled on iOS","user":{"login":"lietu","id":1296558,"avatar_url":"https://avatars.githubusercontent.com/u/1296558?v=3","gravatar_id":"","url":"https://api.github.com/users/lietu","html_url":"https://github.com/lietu","followers_url":"https://api.github.com/users/lietu/followers","following_url":"https://api.github.com/users/lietu/following{/other_user}","gists_url":"https://api.github.com/users/lietu/gists{/gist_id}","starred_url":"https://api.github.com/users/lietu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lietu/subscriptions","organizations_url":"https://api.github.com/users/lietu/orgs","repos_url":"https://api.github.com/users/lietu/repos","events_url":"https://api.github.com/users/lietu/events{/privacy}","received_events_url":"https://api.github.com/users/lietu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-02T13:29:08Z","updated_at":"2015-12-02T13:29:08Z","closed_at":null,"body":"If a user installs the app on iOS, and does not allow push notifications the `registerDevice()` -callbacks do not get called.\r\n\r\n```javascript\r\ndocument.addEventListener('deviceready', function() {\r\n    var plugin = cordova.require('com.pushwoosh.plugins.pushwoosh.PushNotification');\r\n\r\n    plugin.onDeviceReady({\r\n        pw_appid: \"my-app-id\"\r\n    });\r\n\r\n    plugin.registerDevice(\r\n        function() { console.log(\"OK\"); },\r\n        function() { console.log(\"NOT OK\"); }\r\n    );\r\n});\r\n```\r\n\r\nIf push notifications are not allowed (either during first run, or later from system settings), neither callback gets executed.\r\n\r\nIf they are allowed it prints `OK` with the correct configuration.\r\n\r\nI was not able to reproduce on Android by disabling notifications from the app from settings.\r\n\r\nWe can use `getRemoteNotificationStatus()` to check if they are not allowed and skip the `registerDevice` -calls for now, but it would be a lot better to have the error callback be triggered."}}