{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/138","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/138/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/138/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/138","id":106589939,"number":138,"title":"Question concerning frequency of communication with APNs","user":{"login":"dtc7240","id":10062299,"avatar_url":"https://avatars.githubusercontent.com/u/10062299?v=3","gravatar_id":"","url":"https://api.github.com/users/dtc7240","html_url":"https://github.com/dtc7240","followers_url":"https://api.github.com/users/dtc7240/followers","following_url":"https://api.github.com/users/dtc7240/following{/other_user}","gists_url":"https://api.github.com/users/dtc7240/gists{/gist_id}","starred_url":"https://api.github.com/users/dtc7240/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtc7240/subscriptions","organizations_url":"https://api.github.com/users/dtc7240/orgs","repos_url":"https://api.github.com/users/dtc7240/repos","events_url":"https://api.github.com/users/dtc7240/events{/privacy}","received_events_url":"https://api.github.com/users/dtc7240/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-15T16:07:34Z","updated_at":"2015-09-17T20:40:36Z","closed_at":null,"body":"I apologize that I'm not familiar enough with Objective-C to determine the answer to this question myself, and therefore am very grateful in advance to anyone who can answer it for me.\r\n\r\nIn short, the question is:  Does this plugin 'register' with APNs every time `var push = PushNotification.init{...}` is called?  \r\n\r\nMy hope is that the native code in the plugin only communicates with APNs once upon cold start no matter how many times `PushNotification.init{...}` is called.\r\n\r\nBecause I'm in a somewhat unique environment in which I reload the client side Javascript often, I will have to re-initialize each time in order to maintain the `push.on('notification', ...)` listener.  With this plugin's predecessor, one of the iOS options was 'ecb' ... the name of the javascript function to call when a notification was received.  Therefore, I had no problem only registering with APNs once every cold start, as I did not have to re-establish a listener each time the client side Javascript was reloaded.\r\n\r\nI would much prefer to use this newer version of the plugin for several reasons (and kudos to all who have participated in its development):\r\n* Uniform javascript front-end for all platforms\r\n* A Boolean showing whether the app was open in the foreground when a notification was received\r\n* The ability to pass the extra data as a JSON object (the predecessor plugin would only pass flat data)\r\n\r\nMany thanks for a speedy answer so that I know which way I must go...\r\nScott"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/141222070","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/138#issuecomment-141222070","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/138","id":141222070,"user":{"login":"fredgalvao","id":616464,"avatar_url":"https://avatars.githubusercontent.com/u/616464?v=3","gravatar_id":"","url":"https://api.github.com/users/fredgalvao","html_url":"https://github.com/fredgalvao","followers_url":"https://api.github.com/users/fredgalvao/followers","following_url":"https://api.github.com/users/fredgalvao/following{/other_user}","gists_url":"https://api.github.com/users/fredgalvao/gists{/gist_id}","starred_url":"https://api.github.com/users/fredgalvao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredgalvao/subscriptions","organizations_url":"https://api.github.com/users/fredgalvao/orgs","repos_url":"https://api.github.com/users/fredgalvao/repos","events_url":"https://api.github.com/users/fredgalvao/events{/privacy}","received_events_url":"https://api.github.com/users/fredgalvao/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T20:40:36Z","updated_at":"2015-09-17T20:40:36Z","body":"Once a device is registered, it doesn't need to be registered again unless that regId is undone at some point and needs to be restored, so I don't think it **should** actually try to register again.\r\n\r\nIf you happen to lose regIds along the way even though you didn't uninstall your app from such devices, it's probably something related to the certificate (I've had that issue with expired certificates)."}}