Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Abandon Permissions method to Android #1425

Merged
merged 6 commits into from
May 8, 2020

Conversation

GabeConsalter
Copy link
Contributor

@GabeConsalter GabeConsalter commented May 8, 2020

The Abandon Permissions method makes possible to revoke the current token, generating a new one on registration.

Unregister for all remote notifications received via APNS or FCM.

In case many users could be using the same device, Abandon Permissons will be useful to prevent notifications to the previous user from the device, using it in a logout action for example.

Fixes #864

Added the Revoke Token method to Android only. With this method is possible to generate a new token after a logout case with revoking.
Added Revoke Token method descprition at Android Only Methods section
Updated example with the new Revoke Token method, adding a button, alert feedback and necessary calls
@Dallas62 Dallas62 changed the base branch from master to dev May 8, 2020 16:21
@Dallas62
Copy link
Collaborator

Dallas62 commented May 8, 2020

Hi @GabeConsalter
Thanks for this PR, maybe we can rename the method to:

PushNotification.abandonPermissions()

The API will be the same for Android and iOS.

@Dallas62 Dallas62 self-assigned this May 8, 2020
The Revoke Token method has been renamed to Abandon Permissions method
Renamed Revoked Method to Abandon Permissions method. The method from iOS only section was removed and added a new general method section with the new method
@GabeConsalter GabeConsalter changed the title Added Revoke Token (Android only) method Added Abandon Permissions method to Android May 8, 2020
@Dallas62 Dallas62 merged commit 9c26a7b into zo0r:dev May 8, 2020
@Dallas62
Copy link
Collaborator

Dallas62 commented May 8, 2020

I will test it ASAP.

@Dallas62
Copy link
Collaborator

Dallas62 commented May 8, 2020

Released in 3.4.0 due to another fix, no need to reload the application to get the new token 😉

@GabeConsalter
Copy link
Contributor Author

All right, thank you @Dallas62

@Pablo14697
Copy link

Pablo14697 commented Aug 13, 2020

Hi everyone! I think that there is some weird like a default behavior on Android platform. I'm talking about when I create a new RN project and after that I install FCM and react-native-push-notification with the common comands:
yarn add @react-native-firebase/messaging react-native-push-notification

WITHOUT one step more I CAN START TO RECEIVE NOTIFICATIONS. So, I'm new in this library but that is normal? If that's right how can i disable that default behavior and only use the @react-native-firebase/messaging listeners and send a push notification when the listeners get some notification?

I tried with PushNotification.abandonPermissions() but it didn't work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reset token
3 participants