Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.
This repository was archived by the owner on Feb 7, 2019. It is now read-only.

Should we keep didRegisterForRemoteNotificationsWithDeviceToken callback? #209

Open

Description

@joeizy

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.

pushSettings.didRegisterObserver = _addObserver("didRegisterForRemoteNotificationsWithDeviceToken", (result: any) => {
_removeObserver(pushSettings.didRegisterObserver, "didRegisterForRemoteNotificationsWithDeviceToken");
pushSettings.didRegisterObserver = undefined;
const token = result.userInfo.objectForKey('message');
success(token);
});

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.

Activity

  1. zbranzov commented on Apr 13, 2018

    @zbranzov
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions