Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Re-register #250

Closed
adyz opened this issue Oct 21, 2015 · 14 comments
Closed

Re-register #250

adyz opened this issue Oct 21, 2015 · 14 comments
Labels
Milestone

Comments

@adyz
Copy link

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
Copy link

hirbod commented Oct 21, 2015

Yes that should be the correct way

@adyz
Copy link
Author

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
Copy link
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 this to the Release 1.4.0 milestone Oct 21, 2015
@macdonst
Copy link
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
Copy link

@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
Copy link
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
Copy link
Author

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
Copy link
Member

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

@adyz
Copy link
Author

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
Copy link
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
Copy link
Author

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
Copy link
Member

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

@adyz
Copy link
Author

adyz commented Oct 30, 2015

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

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants