-
Notifications
You must be signed in to change notification settings - Fork 254
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
User keeps receiving Pinpoint push notifications after Amplify.Auth.signOut()
#3179
Comments
@dnys1 is there any update on this? Can I assist you with more information? |
Hi @dJani97 - It is recommended that after you can signOut, to then call the |
@abdallahshaban557 thank you for the info! I'm going to try this now:
As a feedback, this is really obscure for me, and it's not documented. Since both I would go as far as to suggest that whenever a user logs out, this unsubscription should be handled automatically, by default. Not doing so is a security risk that developers won't expect. Alternatively, you can warn developers about this in the docs. |
Hi @dJani97 - you are right, we can definitely make that experience better. We will at least cover this in our documentation as a bare minimum, and investigate adding the wrapper API you mentioned. Thank you so much for the feedback! |
Hi @dJani97 - I have just received new information that the best way to make sure you de-associate a user with an endpoint is to pass null to the user_id, rather than passing an empty string. Just wanted to make sure I send this your way. |
hi, |
Yes, it cannot be null. This is my current solution to this problem, and it is working: await Amplify.Notifications.Push.identifyUser(
userId: '',
userProfile: AWSPinpointUserProfile(userAttributes: {}),
); Is is a lot of boilerplate though, and it's very obscure. Notice how I must specify |
We are currently working on improving the API to enable this behavior. We will provide an update here when we make more progress. @dJani97 - just to confirm, setting the userId and userProfile as you did stopped the user from receiving new Notifications? |
@abdallahshaban557 yes. |
Hey @dJani97 thanks for your insights here. Please note that if you save an attribute you must set its value to Ex:
Pinpoint notifications to Segment with Instead you must call: That won't actually delete 'key' though. We are aware of this behavior and have a separate issue for it here: |
How can I unsubscribe user from APNs push notifications from pinpoint upon sign-out with Amplify for react-native v6? |
@victoravr since this question appears to be about react native, can you open an issue here: https://github.com/aws-amplify/amplify-js? Thank you |
Hi @fjnoyp Is there a better solution than clearing all the properties? Maybe updating the endpoint with OptOut = ALL? Thanks |
Description
We use Pinpoint to send push notifications, and to help with that we use the
Amplify.Notifications.Push.identifyUser()
method.But it seems like after a user logs out, the endpoint associated with their current device does not get deleted and they keep receiving push notifications. This is not desired and could be a security concern.
I looked at the docs but couldn't find any information on how and when a pinpoint endpoint gets unregistered. Could you help me with that?
Expected behaviour
Amplify.Auth.signOut()
is calledAmplify.Notifications.Push.unassociateUser()
Additional details
Here is how the client identifies the user with Pinpoint:
And here is how the server targets the client:
Categories
Steps to Reproduce
AmplifyAuthCognito
,AmplifyAPI
,AmplifyAnalyticsPinpoint
,AmplifyPushNotificationsPinpoint
Amplify.Auth.signIn()
Amplify.Notifications.Push.identifyUser()
Amplify.Auth.signOut()
Screenshots
No response
Platforms
Flutter Version
3.10.4
Amplify Flutter Version
1.1.1
Deployment Method
Amplify CLI
Schema
No response
The text was updated successfully, but these errors were encountered: