Skip to main content

I’m trying to add push notifications in a React Native app and following the guide in the React Native SDK for collecting push tokens (https://github.com/klaviyo/klaviyo-react-native-sdk?tab=readme-ov-file#collecting-push-tokens) along with the example app (https://github.com/klaviyo/klaviyo-react-native-sdk/blob/be289e22fbcf70e9e15942f874398064179e9b20/example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm). I’m trying to do the initialization and token collection steps from the React Native layer and I successfully sent a test push on Android. On iOS I already have a Firebase project configured but I’m confused about what I need to do in the AppDelegate based on the steps and the example app. My questions:

  • Do the comments in the example app with step numbers (i.e. “iOS Installation Step 2”) refer to another setup guid I’m missing? or are they just in the example?
  • Do I still need everything in the example app AppDelegate.mm other than the ‘useNativeImplementation’ parts and then add the code under React Native Token Collection? (https://github.com/klaviyo/klaviyo-react-native-sdk?tab=readme-ov-file#react-native-token-collection) My attempt at this has resulted in the warning from Klaviyo: “Your push token is not associated with a profile in Klaviyo”

I’ve read through the docs for the IOS native setup, firebase setup, React Native Firebase setup and my head is swirling. Any help appreciated!

Hi @curtdmiller

  • Do the comments in the example app with step numbers (i.e. “iOS Installation Step 2”) refer to another setup guid I’m missing? or are they just in the example?
    • The steps here are just listing the steps that are used in the example app. 
  • Do I still need everything in the example app AppDelegate.mm other than the ‘useNativeImplementation’ parts and then add the code under React Native Token Collection? (https://github.com/klaviyo/klaviyo-react-native-sdk?tab=readme-ov-file#react-native-token-collection) My attempt at this has resulted in the warning from Klaviyo: “Your push token is not associated with a profile in Klaviyo
    • Can you print out the push token and then verify that the profile exists in Klaviyo? For example if the calls the get_profile with the ID, verify that the ID actually exists in Klaviyo.
    • I also wanted to mention that this repo is currently in beta, so some of the functionality may not be ready for production, have full support, or may be subject to change before it's released to general availability: https://developers.klaviyo.com/en/reference/get_profile

Hope this helps! 

~Chloe


Reply