Closed tyndria closed 1 year ago
Hi @tyndria we have feature-request #3280 open that I believe is asking for the same thing you are asking for in the Push Notification updateEndpoint
method.
However, our PN category relies on Analytics to work and the updateEndpoint
method in Push Notification calls the underlying updateEndpoint
method in the Analytics category. They also share an endpoint when PN is enabled.
To do what you are trying to do, you should be able to call Analytics.updateEndpoint({ optOut: 'ALL' })
to disable PN/other messages for a user
Edit: The above was assuming you are using endpoints to send messages/campaigns to your users rather than the device token. It should have worked in theory, however, after testing this out myself it doesn't seem to be working as expected. Let me discuss this internally and see if we need to fix something and I will respond again to this issue
@tannerabread Thanks for the answer! I was also asking is there a way to to get the value of optOut field without an update. So if the idea is to use optOut field to manage PN, I should be able to check what is the actual value of this field at any moment of the time.
For now I only know about update
function, but I didn't find any get
method in sdk (except REST endpoint)
Hi @tyndria sorry for the delay, I was trying to verify but it looks like we currently do not have a way to get that value in the library. And we have marked this as a bug because the solution I gave you to enable/disable the notifications does not seem to be working as it should.
We will try to post here with any updates on the issue
@tannerabread thank you, I will wait for the fix 👍
Hi @tyndria we have recently released a rewritten Push Notification category with new features, can you try it out and let me know if it works for you?
You can follow the migration steps here or if you are starting again from scratch follow the getting-started guide here
For your previous question, you would change the options by the identifyUser
method and more specifically as follows:
import type { AWSPinpointUserInfo } from '@aws-amplify/notifications'
const userProfile: AWSPinpointUserInfo = {
optOut: 'ALL'
}
Notifications.Push.identifyUser('userid', userProfile)
Hi 👋 Closing this as resolved. This should be handled with the recent release of the rewritten Push Notification category mentioned above.
If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with additional information so we can re-open this issue and be better able to assist you.
Thank you!
@tannerabread thank you, I hope I will be able to check soon!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication, Analytics, GraphQL API, Push Notifications
Amplify Categories
auth, api, notifications
Environment information
Describe the bug
Sorry, "question type" leads to dead page, so I've decided to ask question here
Is there a way to manage enabledness of Push notifications? We want to give user a possibility to stop receiving notifications.
Currently I'm using push notifications module which is working on ios & android (tested using aws pinpoint). I thought that the good option could be to use endpoint
optOut
field, but I don't think there is a way to check the value of this field using amplify package (only REST).So is there a way to allow user to disable & enable push notifications any time if there are integrated thought AWS Pinpoint?
Expected behavior
-
Reproduction steps
-
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response