braze-swift-sdk icon indicating copy to clipboard operation
braze-swift-sdk copied to clipboard

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

Open cheif opened this issue 1 year ago • 8 comments
trafficstars

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

cheif avatar Aug 21 '24 12:08 cheif

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!

jerielng avatar Aug 21 '24 13:08 jerielng

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

cheif avatar Aug 21 '24 13:08 cheif

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 🙏

stefanalund avatar Aug 21 '24 15:08 stefanalund

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.

jerielng avatar Aug 21 '24 16:08 jerielng

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

tssagar98 avatar Sep 09 '24 11:09 tssagar98

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.

jerielng avatar Sep 09 '24 13:09 jerielng

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 !

tssagar98 avatar Sep 09 '24 14:09 tssagar98

@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!

jerielng avatar Sep 09 '24 14:09 jerielng