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

Reregister on Android #291

Closed
Riesling11 opened this issue Nov 2, 2015 · 5 comments
Closed

Reregister on Android #291

Riesling11 opened this issue Nov 2, 2015 · 5 comments
Labels

Comments

@Riesling11
Copy link

Hi, I am using this cool plugin in version 1.4.0 and an Samsung S6 Edge Android 5.1.1 and have the following problem:

The first time everything worked as expected, then I tried to unregister via the unregister() function and than reregister a bit later by calling the init function again. Within the on-register event I got the same registrationId as before. When I am now sending a push notification to the GCM server via PHP I get the following error code: "NotRegistered". Killing and restarting the app doesnt work either, I always get the same registrationID as response from the on-register event and this registration seems to be marked as invalid somehow on the google-server-side. Any tips what I can to avoid this?

I need this unregister/register functionality to give users control in their app-settings to enable and disable push notifications whenever they like.

Thanks for your help,
Philipp

@macdonst macdonst added the bug label Nov 2, 2015
@macdonst
Copy link
Member

macdonst commented Nov 2, 2015

@Riesling11 that's odd according to Google if you call:

InstanceID.getInstance(getApplicationContext()).deleteInstanceID();

as per:

https://developers.google.com/instance-id/guides/android-implementation#delete_tokens_and_product_names

then the next time you call getInstance then you should get a brand new Instance ID. Some investigation is warranted here.

@macdonst
Copy link
Member

macdonst commented Nov 2, 2015

@Riesling11 well crap, I see my bug already. I should be able to fix this today or tomorrow and get a 1.4.1 out soon.

@macdonst
Copy link
Member

macdonst commented Nov 2, 2015

@Riesling11 fixed in 1.4.1 which has been pushed to NPM

@macdonst macdonst closed this as completed Nov 2, 2015
@Riesling11
Copy link
Author

perfect - it works - thanks a lot

chaffeqa added a commit to sportstech/phonegap-plugin-push that referenced this issue Nov 3, 2015
* 'master' of github.com:phonegap/phonegap-plugin-push:
  Version 1.4.2
  Issue phonegap#299: 1.4.x not showing notification on Android
  Version 1.4.1
  Issue phonegap#295: data.registrationId is empty string "" on register event callback
  Issue phonegap#291: Reregister on Android
  [typo] fixing .finish() example
  Update CHANGELOG
  Version 1.4.0
  Issue phonegap#93: Receive Notifications in Background
@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
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Development

No branches or pull requests

2 participants