This repository was archived by the owner on Sep 4, 2020. It is now read-only.
Closed
Conversation
macdonst
suggested changes
Jan 8, 2018
| [pubSub unsubscribeFromTopic:topic]; | ||
| } | ||
| } else { | ||
| [[UIApplication sharedApplication] unregisterForRemoteNotifications]; |
Member
There was a problem hiding this comment.
@ccorcos you can't delete this section as it is required for users who are using APNS to send messages. You have found an issue though and the code should check to see if usesFCM is true. If it is then you should call the deleteIDWithHandler method.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Member
|
@macdonst a reminder to also look at Issue #2082 and this commit delphist2008@365e1a5 |
Member
|
Superceeded by #2509 |
|
This thread has been automatically locked. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves #2130
Description
Rather than disable the ability to receive notifications locally on the phone, we're actually unregistering the token with FCM.
Motivation and Context
A user logs in, we save the token for that user, the user logs out so we call unregister. A new user logs in. These two users should not be sharing the same push notification token.
How Has This Been Tested?
I used this code with my app. Logged in as a user, was able to receive notifications, called unregister on logout, attempted to send a message to that same token and received a
messaging/registration-token-not-registerederror message on the server and never received the message on the phone.Types of changes
This isn't really a breaking change for the plugin, but it is logically different in terms of application code that uses this plugin. They may start to see these unregistered errors. They also can't expect to unregister and then re-init and keep the same token. But I don't imagine these are reasonable expectations.
Checklist: