NativeScript / push-plugin

Contains the source code for the Push Plugin.
Apache License 2.0
123 stars 48 forks source link

Should we keep didRegisterForRemoteNotificationsWithDeviceToken callback? #209

Open joeizy opened 6 years ago

joeizy commented 6 years ago

On the callback for didRegisterForRemoteNotificationsWithDeviceToken on LINE 114 it removes the observer for that event. My concern is that in the Apple Documentation Configuring Remote Notification Support (in the Obtaining a Device Token in iOS and tvOS section) it indicates that if the APNs Device Token changes while your app is running it will invoke the didRegisterForRemoteNotificationsWithDeviceToken callback again with the new Device Token.

NOTE If the device token changes while your app is running, the app object calls the appropriate delegate method again to notify you of the change.

Should we really be removing this handler? It seems like the handler should stay in place so that it can handle new Device Tokens.

https://github.com/NativeScript/push-plugin/blob/a096afc8ee9a44bc13bc986183504d5c0f22c312/src/push-plugin.ios.ts#L113-L118

I'm totally new to mobile dev and just happened to be reading the Apple Docs to make sure I understood how this stuff works.

zbranzov commented 6 years ago

Hi @joeizy, Thanks for pointing this out. We will be glad if you can help us by contributing to the repo with all changes required to improve the behavior.