braze-inc / braze-react-native-sdk

Public repo for the Braze React Native SDK
https://www.braze.com
Other
64 stars 84 forks source link

[Feature]: Can't extract the custom attributes sent via key-value pair on iOS #230

Closed Daneyl closed 1 year ago

Daneyl commented 1 year ago

What problem are you facing?

I am trying to set custom key-value pairs to my push notification and then read those values within the app for Android and iOS and then navigate the user appropriately within the app on the press of that push notification. However, I did find a listener with a callback for Android to read data params attached to some push, however, I couldn't have found the same for the iOS. Help in this regard would be highly appreciated. Thanks

Workarounds

I couldn't find a way as of now to read these values within the React Native SDK.

Ideal Solution

Just like an Android listener, there should be an iOS listener to read those key-value pairs from push notifications. Ideally, the same listener should work for iOS too.

Other Information

No response

jerielng commented 1 year ago

Hey @Daneyl, we have it on our backlog to expose the iOS push listener event to the JavaScript layer, along with other push capabilities. We'll keep you updated in this thread, but in the meantime, you can try doing this in the native layer.

Daneyl commented 1 year ago

@jerielng Umm, I don't have much experience on the native iOS side, I have already made the required changes in the AppDelegrate.mm file. However, I am not sure how this change could make the params (key-value) be available on the JS layer. As I mentioned above, I have to read these params and then navigate the user accordingly to an appropriate screen based on them.

Daneyl commented 1 year ago

Also what's the tentative timeline for getting the iOS push listener out?

jerielng commented 1 year ago

We're actively looking into some solutions here and hope to have some tangible work within the next quarter or so.

jerielng commented 1 year ago

Hey @Daneyl, just an update here: our 8.1.0 release now includes push open events for iOS. You can refer to the available fields here.

I'll go ahead and close out the thread, but feel free to open a new thread if you have any further questions. Thank you!