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

Android - After unregister and reregister no notifications #304

Closed
adyz opened this issue Nov 4, 2015 · 5 comments
Closed

Android - After unregister and reregister no notifications #304

adyz opened this issue Nov 4, 2015 · 5 comments

Comments

@adyz
Copy link

adyz commented Nov 4, 2015

After un-register -- I don't receive any notifications further -- This is what I want.

    if(typeof vv.push === 'undefined') {
        vv.pushinit();
    }

    vv.push.unregister(successHandler, errorHandler);

When I want to enable push notifications back I call back the init function

vv.push = PushNotification.init({

    "android": {
        "senderID": vv.params.googleGCMProjectNumber,
    },
    "ios": {
        "alert": "true",
        "badge": "true",
        "sound": "true"
    }
});

/*
 * When registration is done, store the registration ID;
 */
vv.push.on('registration', function(data) {....

When I reregister, I get the same registrationID, but I don't receive the notifications.

I this the proper way to handle the push notification enable?

Thanks

@bau720123
Copy link

hi @adyz
according to this I post
#296
1.4.2 verison
in Android,it will get a new data.registrationId after unregister and re registration
this is why you can't receive a notification,because you should use a new data.registrationId to send notification

@adyz
Copy link
Author

adyz commented Nov 4, 2015

I get the same registrationId on vv.push.on('registration', function(data) {...
Should I get a new one? If so, how can I do that?

@adyz
Copy link
Author

adyz commented Nov 4, 2015

Looks like I get different id in in 1.4.2 -- I was using 1.4.0.

Thanks

@adyz adyz closed this as completed Nov 4, 2015
@zwacky
Copy link
Contributor

zwacky commented Nov 4, 2015

sorry, misreferenced this.

@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
None yet
Development

No branches or pull requests

3 participants