klaviyo / klaviyo-react-native-sdk

MIT License
5 stars 5 forks source link

Push Notification open event tracking iOS #181

Open SiluntKnight opened 1 month ago

SiluntKnight commented 1 month ago

Checklist

Description

I am trying to track open events for push notifications on our React Native app, I have followed the instructions for Android and that appears to work fine, however for iOS all our native code is written in Objective-C and I believe this to be the case for all RN apps. I can't see a clear example of how we can track these events as the native code for the Klaviyo SDK on iOS is written in Swift. I am missing something here?

Proposed Solution

Provide examples of how you can track events natively through React Native and iOS as suggested is the case in the docs instead of referring to a solely native Swift approach.

Alternatives Considered

No response

Additional Context

No response

ndurell commented 4 weeks ago

Hey there! Sorry for the late response and for the lack of clear documentation on this. We have an example app in this repo. If you don't mind bridging your objective-c code over to our swift you can use this class in our example app. For handling an open push event look at the function handleReceivingPush. Let me know if this helps or if you need more info.

Thanks, Noah

SiluntKnight commented 3 weeks ago

Hi @ndurell thanks for getting back to me, I'm totally new to this - I'll take a look at bridging, thanks for the example that should get me on my way!

ndurell commented 1 week ago

Awesome, hopefully it's not too much of a pain. Hoping in the future we can the integration a bit easier so it doesn't require this.