Re-register #250

Closed
adyz opened this Issue Oct 21, 2015 · 13 comments

Projects

None yet

4 participants

@adyz
adyz commented Oct 21, 2015

Hi guys,

Wonderfull project here.

In my app I have a check-box for notifications (on and of)

On app device ready I call the init method

    push = PushNotification.init({
        "android": {"senderID": "12345679"},
        "ios": {"alert": "true", "badge": "true", "sound": "true"},
        "windows": {}
    });

when the users unchecks the box I call the unregister function

    push.unregister(successHandler, errorHandler);

What do I do to register the user back? Will I call the same init function? is so, the on('registration') does not trigger.

@Hirbod
Hirbod commented Oct 21, 2015

Yes that should be the correct way

@adyz
adyz commented Oct 21, 2015

Cool, thanks for the reply

Thing is that if I do this, the push.on('registration', function(data) { triggers twice. Any idea why?

Thanks!

@macdonst
Member

@adyz I believe I will need to unregister the registration/notification events when unregister is called. Probably a bug, I will re-test.

@macdonst macdonst added the retest label Oct 21, 2015
@macdonst macdonst added this to the Release 1.4.0 milestone Oct 21, 2015
@macdonst
Member

@adyz What platform are you testing on iOS/Android? What version of the operating system? What version of the plugin are you using? I'm having issue reproducing this one.

@kaclark28

@macdonst I have the same issue as @adyz where push.on('registration', .... triggers twice using plugin-push version 1.3.0. I see it happening on an iPad Air 2 with iOS 9.0. I tried it on another device (iPad mini on 6.1.3), and do NOT see a double registration.

@macdonst
Member

@kaclark28 you are probably running into issue #57 which has been fixed in master and will be in the 1.4.0 release. Trying to determine if @adyz has the same problem.

@adyz
adyz commented Oct 22, 2015

I have crosswalk and facebook4 or facebook plugin and I managed to test this only on ios8 and 9 so far due to build failing on android.

@macdonst
Member

@adyz Do you see the same double registration problem on both iOS8 and iOS9?

@adyz
adyz commented Oct 22, 2015

On iOS 8, at the moment I get - no valid 'aps-environment' entitlement string found for application so, not sure, will din into why I get that error on:

push.on('error', function(e) {
    // e.message
    console.log(e.message)
});
@macdonst
Member

@adyz okay if you see the double registration on iOS9 then it is most probably #57 which is fixed in master and will be in the 1.4.0 release (currently in master).

The error you are seeing on iOS8 have something to do with the your application ID not matching your certificate. Make sure that the "Bundle Identifier" in Xcode is what you expect.

@adyz
adyz commented Oct 22, 2015

The iOS8 device is new, so I assume that it has something to do with xcode and apple. When I solve this problem I will let you know what is happening on my devices.

On android this works fine, I don't get two callbacks!

Thank for all the help!

@macdonst
Member

Cannot reproduce, assume it is fixed by the code for issue #57.

@macdonst macdonst closed this Oct 26, 2015
@adyz
adyz commented Oct 30, 2015

Yes, it's fixed. Thanks a lot!!!

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