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 +FirebaseAppDelegateProxyEnabled + +``` + +4. In `application:didRegisterForRemoteNotificationsWithDeviceToken:` method in your `AppDelegate.m` file, you can add the following code to set the push token to the firebase SDK: + +```objective-c +// since we disbaled swizzling, we have to manually set this +FIRMessaging.messaging.APNSToken = deviceToken; +``` + +5. Finally, in your React Native code, you can collect & set the push token as follows: + +```typescript +import messaging from '@react-native-firebase/messaging'; +import { Klaviyo } from 'klaviyo-react-native-sdk'; +import { Platform } from 'react-native'; + +const fetchAndSetPushToken = async () => { + try { + let deviceToken: string | null = null; + if (Platform.OS === 'android') { + deviceToken = await messaging().getToken(); + console.log('FCM Token:', deviceToken); + } else { + deviceToken = await messaging().getAPNSToken(); + console.log('APNs Token:', deviceToken); + } + + if (deviceToken != null && deviceToken.length > 0) { + Klaviyo.setPushToken(deviceToken!); + } + } catch (error) { + console.error('Error in fetchAndSetPushToken:', error); + } +}; +``` + +For android token collection, there isn't any additional setup required on the native side. The above code should work as is. + +#### Native Token Collection + +Follow the platform-specific instructions below: - [Android](https://github.com/klaviyo/klaviyo-android-sdk#Collecting-Push-Tokens) - [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Collecting-Push-Tokens) #### Notification Permission -Requesting user permission to display notifications can be managed in the native layer as instructed in our native SDK -documentation, or with a third party library that provides cross-platform permissions APIs. If you opt for a -cross-platform permission solution, you will still need to provide the Klaviyo SDK with the push token from the -native layer after a permission change. +Requesting user permission to display notifications can be managed in: + +1. The native layer as instructed in our native SDK documentation, + + - [Android](https://github.com/klaviyo/klaviyo-android-sdk#collecting-push-tokens) + - [iOS](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#request-push-notification-permission) + + If you requested permission using native code then continue using Klaviyo's native platform SDKs `setToken` method to inform the SDK of permission change. + +2. Leveraging a third party library that provides cross-platform permissions APIs like firebase [`react-native-firebase/messaging`](https://www.npmjs.com/package/@react-native-firebase/messaging). If you opt for a + cross-platform permission solution, you can now call the Klaviyo's react native SDK's `setToken` method to refresh the token's enablement status. + + Below is an example of how to use `@react-native-firebase/messaging` to request permission and set the token: + +```typescript +import messaging from '@react-native-firebase/messaging'; + +const requestUserPermission = async () => { + let isAuthorized = false; + + if (Platform.OS === 'android') { + const androidAuthStatus = await PermissionsAndroid.request( + PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS + ); + isAuthorized = androidAuthStatus === 'granted'; + } else if (Platform.OS === 'ios') { + const iOsAuthStatus = await messaging().requestPermission(); + isAuthorized = + iOsAuthStatus === messaging.AuthorizationStatus.AUTHORIZED || + iOsAuthStatus === messaging.AuthorizationStatus.PROVISIONAL; + } + + // refer the `fetchAndSetPushToken` method from the previous section for how to get and set the push token + + if (isAuthorized) { + console.log('User has notification permissions enabled.'); + } else { + console.log('User has notification permissions disabled'); + } +}; +``` + +Note that either one of the above approaches is sufficient to inform the Klaviyo SDK of the permission change. ### Receiving Push Notifications diff --git a/Troubeshooting.md b/Troubeshooting.md index 76cb3e9..7083808 100644 --- a/Troubeshooting.md +++ b/Troubeshooting.md @@ -39,3 +39,10 @@ 2. If the command `pod install` 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. + +### `UNUserNotificationCenter` delegate methods not being called + +If you are not seeing the delegate methods for `UNUserNotificationCenter` being called in `AppDelegate`, there are two possible reasons for this, + +1. [Notifee](https://notifee.app/) intercepts the AppDelegate delegate methods and hence you may not receive the delegate calls if notifee is included in the iOS project. The solution is to remove notifee dependency from your project or exclude it for iOS. +2. Firebase iOS SDK also swizzles AppDelegate methods when configured on your iOS app. If after disabling notifee, if the delegates are still not called, this may be the reason. Method swizzling can be turned off by following [Firebase's documentation](https://firebase.google.com/docs/cloud-messaging/ios/client). diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index 28ee7d6..9dcb221 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -19,6 +19,10 @@ --dark-hl-8: #4EC9B0; --light-hl-9: #098658; --dark-hl-9: #B5CEA8; + --light-hl-10: #800000; + --dark-hl-10: #808080; + --light-hl-11: #800000; + --dark-hl-11: #569CD6; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @@ -34,6 +38,8 @@ --hl-7: var(--light-hl-7); --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } } @@ -48,6 +54,8 @@ --hl-7: var(--dark-hl-7); --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } } @@ -62,6 +70,8 @@ --hl-7: var(--light-hl-7); --hl-8: var(--light-hl-8); --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); --code-background: var(--light-code-background); } @@ -76,6 +86,8 @@ --hl-7: var(--dark-hl-7); --hl-8: var(--dark-hl-8); --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); --code-background: var(--dark-code-background); } @@ -89,4 +101,6 @@ .hl-7 { color: var(--hl-7); } .hl-8 { color: var(--hl-8); } .hl-9 { color: var(--hl-9); } +.hl-10 { color: var(--hl-10); } +.hl-11 { color: var(--hl-11); } pre, code { background: var(--code-background); } diff --git a/docs/enums/EventName.html b/docs/enums/EventName.html index af24c42..726518d 100644 --- a/docs/enums/EventName.html +++ b/docs/enums/EventName.html @@ -1,10 +1,10 @@ EventName | klaviyo-react-native-sdk

EventName is a convenience enum for the names of common events that can be tracked.

-

Enumeration Members

Enumeration Members

ADDED_TO_CART_METRIC: number

The 'Added to Cart' event is used to track when a user adds a product to their cart.

-
OPENED_APP_METRIC: number

The 'Opened App' event is used to track when a user opens the app.

-
STARTED_CHECKOUT_METRIC: number

The 'Started Checkout' event is used to track when a user starts the checkout process.

-
VIEWED_PRODUCT_METRIC: number

The 'Viewed Product' event is used to track when a user views a product.

-

Generated using TypeDoc

\ No newline at end of file +
OPENED_APP_METRIC: number

The 'Opened App' event is used to track when a user opens the app.

+
STARTED_CHECKOUT_METRIC: number

The 'Started Checkout' event is used to track when a user starts the checkout process.

+
VIEWED_PRODUCT_METRIC: number

The 'Viewed Product' event is used to track when a user views a product.

+

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/enums/ProfileProperty.html b/docs/enums/ProfileProperty.html index 662ce75..7c61b32 100644 --- a/docs/enums/ProfileProperty.html +++ b/docs/enums/ProfileProperty.html @@ -1,5 +1,5 @@ ProfileProperty | klaviyo-react-native-sdk

Enumeration ProfileProperty

Enum for various profile properties that can be set on a user

-

Enumeration Members

Enumeration Members

ADDRESS1 ADDRESS2 CITY COUNTRY @@ -19,22 +19,22 @@ TITLE ZIP

Enumeration Members

ADDRESS1: number

First line of street address

-
ADDRESS2: number

Second line of street address

-
CITY: number

City name

-
COUNTRY: number

Country name

-
EMAIL: number

Individual's email address

-
EXTERNAL_ID: number

A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.

-
FIRST_NAME: number

Individual's first name

-
IMAGE: number

URL pointing to the location of a profile image

-
LAST_NAME: number

Individual's last name

-
LATITUDE: number

Latitude coordinate. We recommend providing a precision of four decimal places.

-
LOCATION: number

An object containing location information for this profile

-
LONGITUDE: number

Longitude coordinate. We recommend providing a precision of four decimal places.

-
ORGANIZATION: number

Name of the company or organization within the company for whom the individual works

-
PHONE_NUMBER: number

Individual's phone number in E.164 format

-
PROPERTIES: number

An object containing key/value pairs for any custom properties assigned to this profile

-
REGION: number

Region within a country, such as state or province

-
TIMEZONE: number

Time zone name. We recommend using time zones from the IANA Time Zone Database.

-
TITLE: number

Individual's job title

-
ZIP: number

Zip code

-

Generated using TypeDoc

\ No newline at end of file +
ADDRESS2: number

Second line of street address

+
CITY: number

City name

+
COUNTRY: number

Country name

+
EMAIL: number

Individual's email address

+
EXTERNAL_ID: number

A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.

+
FIRST_NAME: number

Individual's first name

+
IMAGE: number

URL pointing to the location of a profile image

+
LAST_NAME: number

Individual's last name

+
LATITUDE: number

Latitude coordinate. We recommend providing a precision of four decimal places.

+
LOCATION: number

An object containing location information for this profile

+
LONGITUDE: number

Longitude coordinate. We recommend providing a precision of four decimal places.

+
ORGANIZATION: number

Name of the company or organization within the company for whom the individual works

+
PHONE_NUMBER: number

Individual's phone number in E.164 format

+
PROPERTIES: number

An object containing key/value pairs for any custom properties assigned to this profile

+
REGION: number

Region within a country, such as state or province

+
TIMEZONE: number

Time zone name. We recommend using time zones from the IANA Time Zone Database.

+
TITLE: number

Individual's job title

+
ZIP: number

Zip code

+

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6ae18da..e2f10f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17,7 +17,11 @@
  • iOS
  • -
  • Initialization
  • +
  • Initialization +
  • Identifying a Profile
    • Retrieve a profile's external ID.

      Parameters

      • callback: undefined | Function

        The callback function to handle the response

        -

      Returns null | String

    • Retrieve a profile's phone number.

      +

    Returns null | String

    • Retrieve a profile's phone number.

      Parameters

      • callback: undefined | Function

        The callback function to handle the response

        -

      Returns null | String

    • Get the push token for the current profile from the SDK

      -

      Parameters

      • callback: undefined | Function

      Returns null | String

    • Initializes the Klaviyo SDK with the given API key.

      +

    Returns null | String

    • Get the push token for the current profile from the SDK

      +

      Parameters

      • callback: undefined | Function

      Returns null | String

    • Initializes the Klaviyo SDK with the given API key.

      Parameters

      • apiKey: string

        Your public API key

        -

      Returns void

    • Clear the current profile and set it to a new anonymous profile

      -

      Returns void

    • Update a profile's email address.

      +

    Returns void

    • Clear the current profile and set it to a new anonymous profile

      +

      Returns void

    • Update a profile's email address.

      Parameters

      • email: String

        The email address to set

        -

      Returns void

    • Update a profile's external ID.

      +

    Returns void

    • Update a profile's external ID.

      Parameters

      • externalId: String

        The external ID to set

        -

      Returns void

    • Update a profile's phone number.

      +

    Returns void

    • Update a profile's phone number.

      Parameters

      • phoneNumber: String

        The phone number to set

        -

      Returns void

    • Create and update properties about a profile without tracking an associated event.

      +

    Returns void

    • Create and update properties about a profile without tracking an associated event.

      Parameters

      • profile: Profile

        The profile object to set

        -

      Returns void

    • Update a profile's properties.

      +

    Returns void

    • Update a profile's properties.

      Parameters

      • propertyKey: ProfilePropertyKey

        The property key to set

      • value: String

        The property value to set

        -

      Returns void

    • Set the push token for the current profile

      -

      Parameters

      • token: String

      Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    • Set the push token for the current profile

      +

      Parameters

      • token: String

      Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Location.html b/docs/interfaces/Location.html index 7cb4c3b..3376fd7 100644 --- a/docs/interfaces/Location.html +++ b/docs/interfaces/Location.html @@ -1,5 +1,5 @@ Location | klaviyo-react-native-sdk

    Interface for location information of a profile

    -
    interface Location {
        address1?: string;
        address2?: string;
        city?: string;
        country?: string;
        latitude?: number;
        longitude?: number;
        region?: string;
        timezone?: string;
        zip?: string;
    }

    Properties

    interface Location {
        address1?: string;
        address2?: string;
        city?: string;
        country?: string;
        latitude?: number;
        longitude?: number;
        region?: string;
        timezone?: string;
        zip?: string;
    }

    Properties

    Properties

    address1?: string

    First line of street address

    -
    address2?: string

    Second line of street address

    -
    city?: string

    City name

    -
    country?: string

    Country name

    -
    latitude?: number

    Latitude coordinate. We recommend providing a precision of four decimal places.

    -
    longitude?: number

    Longitude coordinate. We recommend providing a precision of four decimal places.

    -
    region?: string

    Region within a country, such as state or province

    -
    timezone?: string

    Time zone name. We recommend using time zones from the IANA Time Zone Database.

    -
    zip?: string

    Zip code

    -

    Generated using TypeDoc

    \ No newline at end of file +
    address2?: string

    Second line of street address

    +
    city?: string

    City name

    +
    country?: string

    Country name

    +
    latitude?: number

    Latitude coordinate. We recommend providing a precision of four decimal places.

    +
    longitude?: number

    Longitude coordinate. We recommend providing a precision of four decimal places.

    +
    region?: string

    Region within a country, such as state or province

    +
    timezone?: string

    Time zone name. We recommend using time zones from the IANA Time Zone Database.

    +
    zip?: string

    Zip code

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Profile.html b/docs/interfaces/Profile.html index 611ac1c..c9bc636 100644 --- a/docs/interfaces/Profile.html +++ b/docs/interfaces/Profile.html @@ -1,5 +1,5 @@ Profile | klaviyo-react-native-sdk

    Interface for a profile

    -
    interface Profile {
        email?: string;
        externalId?: string;
        firstName?: string;
        image?: string;
        lastName?: string;
        location?: Location;
        organization?: string;
        phoneNumber?: string;
        properties?: ProfileProperties;
        title?: string;
    }

    Properties

    interface Profile {
        email?: string;
        externalId?: string;
        firstName?: string;
        image?: string;
        lastName?: string;
        location?: Location;
        organization?: string;
        phoneNumber?: string;
        properties?: ProfileProperties;
        title?: string;
    }

    Properties

    Properties

    email?: string

    Individual's email address

    -
    externalId?: string

    A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.

    -
    firstName?: string

    Individual's first name

    -
    image?: string

    URL pointing to the location of a profile image

    -
    lastName?: string

    Individual's last name

    -
    location?: Location

    An object containing location information for this profile

    -
    organization?: string

    Name of the company or organization within the company for whom the individual works

    -
    phoneNumber?: string

    Individual's phone number in E.164 format

    -
    properties?: ProfileProperties

    An object containing key/value pairs for any custom properties assigned to this profile

    -
    title?: string

    Individual's job title

    -

    Generated using TypeDoc

    \ No newline at end of file +
    externalId?: string

    A unique identifier used by customers to associate Klaviyo profiles with profiles in an external system, such as a point-of-sale system. Format varies based on the external system.

    +
    firstName?: string

    Individual's first name

    +
    image?: string

    URL pointing to the location of a profile image

    +
    lastName?: string

    Individual's last name

    +
    location?: Location

    An object containing location information for this profile

    +
    organization?: string

    Name of the company or organization within the company for whom the individual works

    +
    phoneNumber?: string

    Individual's phone number in E.164 format

    +
    properties?: ProfileProperties

    An object containing key/value pairs for any custom properties assigned to this profile

    +
    title?: string

    Individual's job title

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/EventProperties.html b/docs/types/EventProperties.html index 4dee2b0..f13497f 100644 --- a/docs/types/EventProperties.html +++ b/docs/types/EventProperties.html @@ -1,2 +1,2 @@ EventProperties | klaviyo-react-native-sdk

    Type alias EventProperties

    EventProperties: Record<string, Object>

    Type for event properties

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/ProfileProperties.html b/docs/types/ProfileProperties.html index a3ac1e5..82e978c 100644 --- a/docs/types/ProfileProperties.html +++ b/docs/types/ProfileProperties.html @@ -1,2 +1,2 @@ ProfileProperties | klaviyo-react-native-sdk

    Type alias ProfileProperties

    ProfileProperties: Record<ProfilePropertyKey, Object>

    Type for profile properties

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/ProfilePropertyKey.html b/docs/types/ProfilePropertyKey.html index 44097b0..435b9a8 100644 --- a/docs/types/ProfilePropertyKey.html +++ b/docs/types/ProfilePropertyKey.html @@ -1,2 +1,2 @@ ProfilePropertyKey | klaviyo-react-native-sdk

    Type alias ProfilePropertyKey

    ProfilePropertyKey: ProfileProperty | string

    Type for a profile property key

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/variables/Klaviyo.html b/docs/variables/Klaviyo.html index 79db5f8..b4b1dba 100644 --- a/docs/variables/Klaviyo.html +++ b/docs/variables/Klaviyo.html @@ -1,2 +1,2 @@ Klaviyo | klaviyo-react-native-sdk

    Variable KlaviyoConst

    Klaviyo: Spec = ...

    Implementation of the KlaviyoInterface

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm b/example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm index 3e1d25f..2e24fea 100644 --- a/example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm +++ b/example/ios/KlaviyoReactNativeSdkExample/AppDelegate.mm @@ -130,6 +130,13 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction return [RCTLinkingManager application:app openURL:url options:options]; } +// Installation Step 13: Implement this method to receive deep link. There are some addition setup steps needed as mentioned in the readme here - +// https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#deep-linking +// Calling `RCTLinkingManager` is required for your react native listeners to be called +- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { + return [RCTLinkingManager application:app openURL:url options:options]; +} + // Installation Step 13: Implement this method to receive deep link. There are some addition setup steps needed as mentioned in the readme here - // https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#deep-linking // additionally routing to the right screen in the app based on the url is also something that should be handled