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

[Feature]: Ability to read SubscriptionState for users Push/Email states. #137

Open
cheif opened this issue Aug 21, 2024 · 8 comments
Open

Comments

@cheif
Copy link

cheif commented Aug 21, 2024

What problem are you facing?

Me and @stefanalund are looking into building a "Marketing settings" page in our app following the guide, where we'd let the able opt-out of push and email marketing, all backed by the braze-sdk. We've found set(pushNotificationSubscriptionState:) and the corresponding API for email, but we can't figure out how to read the users current preferences.

Are we just missing where we could read user.pushNotificationSubscriptionState/user.emailSubscriptionState through the SDK, or is this something that can be added, it seems like this is needed to be able to build a fully functional "Marketing settings".

Workarounds

Not that we know of.

Ideal Solution

The SDK added support for reading the SubscriptionState for email/push.

Other Information

No response

@jerielng
Copy link
Collaborator

Hi @cheif, you are correct that there are no such getter properties/methods for the push and email subscription state. The set methods are designed to simply forward that information from the SDK on device to the Braze servers.

Could you work with our support team at [email protected] to further explore potential options here? Thank you!

@cheif
Copy link
Author

cheif commented Aug 21, 2024

@jerielng Thank's, I've reached out to them now.

@stefanalund
Copy link

SDK integration
You can update a user’s subscription state with the Braze SDK using the setPushNotificationSubscriptionType method on Web , Android , or iOS . For example, you can use this method to create a settings page in your app where users can manually enable or disable push notifications.

Your documentation ☝️ says that the SDK can be used to create a settings screen in our app. @jerielng I would argue that it's not possible to do that without a getter function. At least not with a reasonable UX. I'm curious why you think this is a support question and not something for this repo's maintainers to address? Thanks 🙏

@jerielng
Copy link
Collaborator

jerielng commented Aug 21, 2024

Hey @stefanalund! The idea of managing user state across devices is not solely owned by the SDK, so sending this through the formal support process will get it in front of all relevant teams that can make a decision on whether there are alternative solutions currently available that can be explored or if this should be classified a feature request.

@tssagar98
Copy link

Can i use the rest api? to get the SubscriptionState ?

@jerielng
Copy link
Collaborator

jerielng commented Sep 9, 2024

Hey @tssagar98, that is one potential option that you're welcome to try (I believe you're referring to the strategy described here).The results can vary based on your needs and use case, which is why we recommend going through the support channels mentioned above to determine if this is the solution that works best for you.

@tssagar98
Copy link

Thank you for you response @jerielng , I have tried to use the REST API Call but i am not getting updated value from it I have used /users/export/ids endpoint and in response i am always getting opted_in i am also updating he SubscriptionState using self.braze?.user.set(pushNotificationSubscriptionState: option)

Thanks !

@jerielng
Copy link
Collaborator

jerielng commented Sep 9, 2024

@tssagar98 Could you write in to [email protected] with further details of your project along with your integration code (attaching this GitHub issue as a reference) so that our support team can assist you? Thanks!

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

No branches or pull requests

4 participants