diff --git a/README.md b/README.md
index a1c6ddd..fa8201f 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,8 @@
- [Android](#android-1)
- [iOS](#ios-1)
- [Initialization](#initialization)
+ - [React Native Initialization](#react-native-initialization)
+ - [Native Initialization](#native-initialization)
- [Identifying a Profile](#identifying-a-profile)
- [Reset Profile](#reset-profile)
- [Anonymous Tracking](#anonymous-tracking)
@@ -25,6 +27,8 @@
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Collecting Push Tokens](#collecting-push-tokens)
+ - [React Native Token Collection](#react-native-token-collection)
+ - [Native Token Collection](#native-token-collection)
- [Receiving Push Notifications](#receiving-push-notifications)
- [Rich Push](#rich-push)
- [Tracking Open Events](#tracking-open-events)
@@ -86,9 +90,11 @@ yarn add klaviyo-react-native-sdk
```
### Example App
+
We have included a bare-bones example app in this repository for reference of how to integrate with our SDK.
It is primarily intended to give code samples such as how and where to `initialize` or how to implement notification
delegate methods on iOS. To actually run the example app:
+
- Clone this repository
- From the root directory, run `yarn example-setup`. This is an alias that will do the following:
- Run `yarn install --immutable` from the root directory
@@ -129,85 +135,28 @@ Install [Cocoapods](https://cocoapods.org/) if you have not already.
## Initialization
-The SDK must be initialized with the short alphanumeric
-[public API key](https://help.klaviyo.com/hc/en-us/articles/115005062267#difference-between-public-and-private-api-keys1)
-for your Klaviyo account, also known as your Site ID. Initialization is done in the native layer, and must occur before
-any other SDK methods can be invoked. Follow the native SDK instructions for initialization, and refer to the
-[example app](./example) in this repository for guidance:
-
-- [Android SDK instructions](https://github.com/klaviyo/klaviyo-android-sdk#Initialization), and
- [example app `MainApplication.kt`](./example/android/app/src/main/java/com/klaviyoreactnativesdkexample/MainApplication.kt#L39)
-- [iOS SDK instructions](https://github.com/klaviyo/klaviyo-swift-sdk#Initialization), and
- [example app `AppDelegate.mm`](./example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm#L14)
-
-### Example App
-We have included a bare-bones example app in this repository for reference of how to integrate with our SDK.
-It is primarily intended to give code samples such as how and where to `initialize` or how to implement notification
-delegate methods on iOS. To actually run the example app:
-- Clone this repository
-- From the root directory, run `yarn example-setup`. This is an alias that will do the following:
- - Run `yarn install --immutable` from the root directory
- - Navigate to the `example` directory and run `bundle install`
- - Navigate to the `example/ios` directory and run `bundle exec pod install`
-- From the project's root directory, run `yarn example start` to start the example application. Follow the
- metro instructions from here, i.e. press `i` to run on iOS or `a` to run on Android.
-
-### Android
-
-Android installation requirements may vary depending upon your project configuration and other dependencies.
-The Klaviyo React Native SDK's `build.gradle` file exposes transitive dependencies upon the Klaviyo Android SDK,
-so you can import Android Klaviyo SDK references from your Kotlin/Java files without modifying your gradle configuration.
-
-#### React Native 0.73.x
-
-There are no additional installation requirements. Android support is fully tested and verified,
-including `minSdkVersion=23`.
-
-#### React Native 0.68.x - 0.72.x
-
-We have successfully compiled the Klaviyo React Native SDK in a bare React Native template app for these versions
-with the following modifications to the `android/build.gradle` file:
-
-- Set `compileSdkVersion=34`
-- Set `minSdkVersion=23`
-
-#### React Native <= 0.67.x
-
-We are actively working to verify compatibility with these versions. If you encounter issues, please file an issue.
-
-### iOS
+The SDK must be initialized with the short alphanumeric [public API key](https://help.klaviyo.com/hc/en-us/articles/115005062267#difference-between-public-and-private-api-keys1)
+for your Klaviyo account, also known as your Site ID.
-After installing the npm package, run the following command in the `ios` directory of your React Native project.
-Install [Cocoapods](https://cocoapods.org/) if you have not already.
+Initialize _must_ be called prior to invoking any other SDK methods so that Klaviyo SDK can track profiles, events and push tokens toward the correct Klaviyo account.
+Any SDK operations invoked before initialize will be dropped, and result in a logged error.
-#### React Native 0.68.x - 0.72.x
-We have successfully compiled the Klaviyo React Native SDK in a bare React Native template app for these versions
-with the following modifications to the `android/build.gradle` file:
-- Set `compileSdkVersion=34`
-- Set `minSdkVersion=23`
+You can call `initialize` from your app's React Native layer or from the platform-specific native code.
+This decision is dependent on your app's architecture. It is not required to initialize the SDK in both places!
+Note: It is safe to re-initialize, e.g. if your app needs to connect to more than one Klaviyo account.
-#### React Native <= 0.67.x
-We are actively working to verify compatibility with these versions. If you encounter issues, please file an issue.
+### React Native Initialization
-#### Android Troubleshooting
-- We have seen projects, particularly on react-native versions `0.72.x` and `0.71.x`, that required a `minSdkVersion`
- of `24`, despite the Klaviyo Android SDK supporting API 23+. If you encounter this, please file an issue in our
- repository and provide version numbers of your react-native dependencies.
+Below is an example of how to initialize the SDK from your React Native code:
-### iOS
-After installing the npm package, run the following command in the `ios` directory of your React Native project.
-Install [Cocoapods](https://cocoapods.org/) if you have not already.
-```sh
-pod install
+```typescript
+import { Klaviyo } from 'klaviyo-react-native-sdk';
+Klaviyo.initialize('YOUR_KLAVIYO_PUBLIC_API_KEY');
```
-> ℹ️ if the above command is outputting version mismatch errors for `KlaviyoSwift`, please run `pod update KlaviyoSwift` as indicated in the error message to update your local pods spec repo.
-## Initialization
+### Native Initialization
-The SDK must be initialized with the short alphanumeric
-[public API key](https://help.klaviyo.com/hc/en-us/articles/115005062267#difference-between-public-and-private-api-keys1)
-for your Klaviyo account, also known as your Site ID. Initialization is done in the native layer, and must occur before
-any other SDK methods can be invoked. Follow the native SDK instructions for initialization, and refer to the
+Follow the native SDK instructions for initialization, and refer to the
[example app](./example) in this repository for guidance:
- [Android SDK instructions](https://github.com/klaviyo/klaviyo-android-sdk#Initialization), and
@@ -333,17 +282,111 @@ Refer to the following README sections on push setup:
### Collecting Push Tokens
-Push tokens must be collected in the native layer. Follow the platform-specific instructions below:
+Push tokens can be collected either from your app's react native code or in the native code. Below sections discuss both approaches, and
+you are free to pick one that best suits your app's architecture. Note that doing this in one location is sufficient.
+
+#### React Native Token Collection
+
+In order to collect the APNs push token in your React Native code you need to:
+
+1. Import a library such as [`@react-native-firebase/messaging`](https://www.npmjs.com/package/@react-native-firebase/messaging) to your react native project. The below instructions are specific for `@react-native-firebase/messaging` library.
+2. Import Firebase iOS SDK to your iOS project. Setup instructions can be found [here](https://firebase.google.com/docs/ios/setup).
+3. In order for the `UNUserNotificationCenter` delegate methods to be called in `AppDelegate`, method swizzling should be disabled for the Firebase SDK. For more information on this,
+ please refer to the [Firebase documentation](https://firebase.google.com/docs/cloud-messaging/ios/client). Disabling method swizzling be done by adding the following to your `Info.plist`:
+
+```xml
+
The 'Added to Cart' event is used to track when a user adds a product to their cart.
-The 'Opened App' event is used to track when a user opens the app.
-The 'Started Checkout' event is used to track when a user starts the checkout process.
-The 'Viewed Product' event is used to track when a user views a product.
-Generated using TypeDoc
The 'Opened App' event is used to track when a user opens the app.
+The 'Started Checkout' event is used to track when a user starts the checkout process.
+The 'Viewed Product' event is used to track when a user views a product.
+Generated using TypeDoc
EventName is a convenience enum for the names of common events that can be tracked.
-