diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5479a5..6182a21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,7 +123,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2.2' + ruby-version: '2.6.10' - name: Setup uses: ./.github/actions/setup @@ -158,54 +158,11 @@ jobs: - name: Install cocoapods if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' run: | - yarn pod-install example/ios - brew install watchman + cd example/ios + pod install env: NO_FLIPPER: 1 - name: Build example for iOS run: | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" - - - generate-documentation: - # Only run on master branch push (e.g. after pull request merge). - if: github.event_name == 'push' - runs-on: ubuntu-22.04 - env: - CI_COMMIT_MESSAGE: Generated docs for ${{ github.sha }} - GH_TOKEN: ${{ github.token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: documentation - fetch-depth: 0 - - - name: Setup - uses: ./.github/actions/setup - - - name: Git config - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git fetch origin - - - name: Create branch for docs PR - run: | - git checkout -b "documentation-${{ github.sha }}" - git merge origin/master --no-edit --strategy-option theirs - - - name: Generate docs - run: | - yarn generate-docs - - - name: Commit and push docs - run: | - git add docs - git commit -m "${{ env.CI_COMMIT_MESSAGE }}" - git push -u origin "documentation-${{ github.sha }}" - - - name: Create PR for doc updates - run: | - gh pr create --draft --title "Generated Docs for \"$(git show -s --format=%B ${{ github.sha }})\"" --body "This PR was automatically generated by a GitHub Action for ${{ github.sha }}." -B "documentation" -H "documentation-${{ github.sha }}" diff --git a/.github/workflows/doc-bot.yml b/.github/workflows/doc-bot.yml new file mode 100644 index 0000000..7fa9943 --- /dev/null +++ b/.github/workflows/doc-bot.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + + generate-documentation: + runs-on: ubuntu-22.04 + env: + CI_COMMIT_MESSAGE: Generated docs for ${{ github.sha }} + GH_TOKEN: ${{ github.token }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: documentation + fetch-depth: 0 + + - name: Setup + uses: ./.github/actions/setup + + - name: Git config + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git fetch origin + + - name: Create branch for docs PR + run: | + git checkout -b "documentation-${{ github.sha }}" + git merge origin/master --no-edit --strategy-option theirs + + - name: Generate docs + run: | + yarn generate-docs + + - name: Commit and push docs + run: | + if [ $(git status -s -uno | wc -l) -eq 0 ]; then + echo "No documentation to change" + exit 0 + fi + + git add docs + git commit -m "${{ env.CI_COMMIT_MESSAGE }}" + git push -u origin "documentation-${{ github.sha }}" + + - name: Create PR for doc updates + run: | + gh pr create --title "Generated Docs for \"$(git show -s --format=%B ${{ github.sha }})\"" --body "This PR was automatically generated by a GitHub Action for ${{ github.sha }}." -B "documentation" -H "documentation-${{ github.sha }}" diff --git a/README.md b/README.md index 2fdb3c2..32adfff 100644 --- a/README.md +++ b/README.md @@ -2,99 +2,124 @@ ⚠️ This repository is in beta development ⚠️ -Official Klaviyo React Native SDK +The Klaviyo React Native SDK allows developers to incorporate Klaviyo analytics and push notification functionality in +their React Native applications for Android and iOS. It is a Typescript wrapper (native module bridge) around the native +Klaviyo iOS and Android SDKs. For more information on the native SDKs, please see the +[iOS](https://github.com/klaviyo/klaviyo-swift-sdk) and [Android](https://github.com/klaviyo/klaviyo-android-sdk). +repositories. This repo also contains a basic [React Native sample app](./example) to assist your integration. -## Overview +The SDK assists in identifying users and tracking user events via the latest [Klaviyo Client APIs](https://developers.klaviyo.com/en/reference/api_overview). +To reduce performance overhead, API requests are queued and sent in batches. The queue is persisted to local storage +so that data is not lost if the device is offline or the app is terminated. -klaviyo-react-native-sdk is an SDK, written in TypeScript, that can be integrated into your React Native App. -The SDK enables you to engage with your customers using push notifications. In addition, you will be able to take advantage of Klaviyo's identification and event tracking functionality. -Once integrated, your marketing team will be able to better understand your app users' needs and send them timely messages via APNs/Google FCM. +Once integrated, your marketing team will be able to better understand your app users' needs and send them timely +push notifications via FCM (Firebase Cloud Messaging) and APNs (Apple Push Notification Service). -This SDK is a wrapper (native module bridge) around the native Klaviyo iOS and Android SDKs. -For more information on the native SDKs, please see the [iOS](https://github.com/klaviyo/klaviyo-swift-sdk) and [Android](https://github.com/klaviyo/klaviyo-android-sdk) repositories. +## Requirements +For initial beta release, the SDK was developed and tested against the latest minor release of React Native (0.73). +We are actively testing and expanding support to the latest patch releases of recent minor versions of React Native. -## Installation - -The Klaviyo React Native SDK is available via [NPM](http://npmjs.com). To add it to your project, run the following from your project's root directory: +### React Native +- `0.68.7+` - We have successfully compiled this SDK on a bare React Native template app down to `0.68.7`. + Testing is ongoing to verify on older versions. -```sh -npm install klaviyo-react-native-sdk -``` +### Android +- `minSdkVersion` of `23+` +- `compileSdkVersion` of `34+` -### iOS Setup +### iOS +- Minimum Deployment Target `13.0+` -To get started with iOS setup, you need to run the following command in the `ios` directory of your React Native project: +## Installation +The Klaviyo React Native SDK is available via [NPM](http://npmjs.com). To add it to your project, +run the following from your project's root directory: ```sh -pod install -``` - -This may require you to install [Cocoapods](https://cocoapods.org/). - -Once you have installed all the dependencies using cocoapods, you should have access to the native Klaviyo iOS SDK which we will use in the following section to setup your react native iOS project. - -### Troubleshooting pod install issues - -if you are seeing issues with deployment versions when installing pods, -you may need to update you minimum iOS version to 13.0 in your Podfile. - -An example of overriding the minimum iOS version in your Podfile is shown below: - -```ruby -MIN_IOS_OVERRIDE = '13.0' -if Gem::Version.new(MIN_IOS_OVERRIDE) > Gem::Version.new(min_ios_version_supported) - min_ios_version_supported = MIN_IOS_OVERRIDE -end -# existing code -platform :ios, min_ios_version_supported -``` - -Another option is to use `IPHONEOS_DEPLOYMENT_TARGET` from your Xcode project file like below, - -```ruby -####### -# Read min iOS version from Xcode project and set as min iOS version for Podfile -require 'xcodeproj' - -project_path = './YOUR_XCODE_PROJECT.xcodeproj' -project = Xcodeproj::Project.open(project_path) -min_ios_version_supported = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] -###### +# Using npm +npm install klaviyo-react-native-sdk -platform :ios, min_ios_version_supported +# Using yarn +yarn add klaviyo-react-native-sdk ``` -### Android Setup - -For Android, there are no additional installation requirements. The React Native SDK gradle file exposes transitive dependencies upon the Klaviyo Android SDK -so you can import in your kotlin/java classes without modifying your gradle files. +### 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. -## SDK Initialization +#### React Native 0.73.x +There are no additional installation requirements. Android support is fully tested and verified, +including `minSdkVersion=23`. -Initialization should be done from the native layer: +#### 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` -### Android +#### React Native <= 0.67.x +We are actively working to verify compatibility with these versions. If you encounter issues, please file an issue. -Follow the [Android](https://github.com/klaviyo/klaviyo-android-sdk#Initialization) guide on initializing. +#### 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. ### iOS - -Here we'll create the native iOS SDK instance and initialize it with your Klaviyo public key. - -```swift -KlaviyoSDK().initialize(with: "YOUR_KLAVIYO_PUBLIC_API_KEY") +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 --repo-update ``` +#### iOS Troubleshooting +If you are seeing issues related to `minimum deployment target` when installing pods, you may need to update your +minimum iOS version to 13.0 in your Podfile with one of the following strategies. +- Specify iOS version directly in the `Podfile`: + ```ruby + MIN_IOS_OVERRIDE = '13.0' + if Gem::Version.new(MIN_IOS_OVERRIDE) > Gem::Version.new(min_ios_version_supported) + min_ios_version_supported = MIN_IOS_OVERRIDE + end + # existing code + platform :ios, min_ios_version_supported + ``` +- Set the deployment target to 13.0 in XCode, and then pull `IPHONEOS_DEPLOYMENT_TARGET` from the XCode project: + ```ruby + ####### + # Read min iOS version from Xcode project and set as min iOS version for Podfile + require 'xcodeproj' + + project_path = './YOUR_XCODE_PROJECT.xcodeproj' + project = Xcodeproj::Project.open(project_path) + min_ios_version_supported = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] + ###### + + platform :ios, min_ios_version_supported + ``` + +## 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) + ## Identifying a Profile +The SDK provides methods to identify profiles via the +[Create Client Profile API](https://developers.klaviyo.com/en/reference/create_client_profile). +A profile can be identified by any combination of the following: -The SDK provides helpers for identifying profiles and syncing via the -[Klaviyo client API](https://developers.klaviyo.com/en/reference/create_client_profile). -All profile identifiers (email, phone, external ID, anonymous ID) are persisted to local storage -so that the SDK can keep track of the current profile. +- External ID: 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. +- Individual's email address +- Individual's phone number in [E.164 format](https://help.klaviyo.com/hc/en-us/articles/360046055671#h_01HE5ZYJEAHZKY6WZW7BAD36BG) -The Klaviyo SDK does not validate email address or phone number inputs locally. See -[documentation](https://help.klaviyo.com/hc/en-us/articles/360046055671-Accepted-phone-number-formats-for-SMS-in-Klaviyo) -for guidance on proper phone number formatting. +Identifiers are persisted to local storage on each platform so that the SDK can keep track of the current profile. Profile attributes can be set all at once: @@ -128,7 +153,12 @@ Klaviyo.setExternalId('12345'); Klaviyo.setProfileAttribute(ProfilePropertyKey.FIRST_NAME, 'Kermit'); ``` -If a user is logged out or if you want to reset the profile for some reason, use the following: +Either way, the native SDKs will group and batch API calls to improve performance. + +### Reset Profile +To start a _new_ profile altogether (e.g. if a user logs out), either call `Klaviyo.resetProfile()` +to clear the currently tracked profile identifiers (e.g. on logout), or use `Klaviyo.setProfile(profile)` +to overwrite it with a new profile object. ```typescript import { Klaviyo } from 'klaviyo-react-native-sdk'; @@ -136,11 +166,16 @@ import { Klaviyo } from 'klaviyo-react-native-sdk'; Klaviyo.resetProfile(); ``` -## Event Tracking +### Anonymous Tracking +Klaviyo will track unidentified users with an autogenerated ID whenever a push token is set or an event is created. +That way, you can collect push tokens and track events prior to collecting profile identifiers such as email or +phone number. When an identifier is provided, Klaviyo will merge the anonymous user with an identified user. -The SDK also provides tools for tracking analytics events to the Klaviyo API. -A list of common Klaviyo-defined event names is provided in [MetricName](https://github.com/klaviyo/klaviyo-react-native-sdk/blob/master/src/Event.ts), or -you can just provide a string for a custom event name. +## Event Tracking +The SDK also provides tools for tracking analytics events via the +[Create Client Event API](https://developers.klaviyo.com/en/reference/create_client_event). +A list of common Klaviyo-defined event metrics is provided in [`MetricName`](https://github.com/klaviyo/klaviyo-react-native-sdk/blob/master/src/Event.ts), +or you can just provide a string for a custom event name. Below is an example using one of the Klaviyo-defined event names: @@ -164,40 +199,75 @@ import { Klaviyo } from 'klaviyo-react-native-sdk'; Klaviyo.createEvent({ name: 'My Custom Event', }); -Klaviyo.createEvent(event); ``` ## Push Notifications -When setting up push notifications (including rich push notifications), you will need to follow directions from the [iOS](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#Push-Notifications) and [Android](https://github.com/klaviyo/klaviyo-android-sdk?tab=readme-ov-file#Push-Notifications) SDKs. - -## Deep Linking - -To handle deep links in your app, start by familiarizing yourself with the React Native [guide](https://reactnative.dev/docs/linking) to deep linking. Once you've done that, you should follow directions from the [iOS](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#Deep-Linking) and [Android](https://github.com/klaviyo/klaviyo-android-sdk?tab=readme-ov-file#Deep-Linking) SDKs. -The sections below give additional details for each platform as it pertains to React Native. - -### iOS - -As shown in the native SDK documentation, you can follow option 1 or 2. - -With option 1, when you get the callback, you can handle it as follows: - -```objective-c -[RCTLinkingManager application:application openURL:url options:options] -``` - -Since you won't have `options`, you can just pass in an empty dictionary for that parameter. - -With option 2, when you handle the open url (in [`application(_:open:options)`](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application)), -you call the linking code block above similar to what you would do with option 1. - -### Android - -On Android, simply follow the [Android SDK docs](https://github.com/klaviyo/klaviyo-android-sdk?tab=readme-ov-file#Deep-Linking) on handling intent filters. - -### React Native Changes - -Then on the React Native side, you can handle the deep link as follows: +### Prerequisites +Integrating push notifications is highly platform-specific. Begin by thoroughly reviewing the setup +instructions for Push Notifications in the README from each native Klaviyo SDK: +- [Android](https://github.com/klaviyo/klaviyo-android-sdk#Push-Notifications) +- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Push-Notifications) + +### Setup +Refer to the following README sections on push setup: +- [Android](https://github.com/klaviyo/klaviyo-android-sdk#Setup) +- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Setup) + +### Collecting Push Tokens +Push tokens must be collected in the native layer. 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. + +### Receiving Push Notifications +You can send test notifications to a specific token using the +[push notification preview](https://help.klaviyo.com/hc/en-us/articles/18011985278875) +feature in order to test your integration. + +#### Rich Push +[Rich Push](https://help.klaviyo.com/hc/en-us/articles/16917302437275) is the ability to add images to +push notification messages. On iOS, you will need to implement an extension service to attach images to notifications. +No additional setup is needed to support rich push on Android. +- [Android](https://github.com/klaviyo/klaviyo-android-sdk#Rich-Push) +- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Rich-Push) + +#### Tracking Open Events +Klaviyo tracks push opens events with a specially formatted event `Opened Push` that includes message tracking +parameters in the event properties. To track push opens, you will need to follow platform-specific instructions: +- [Android](https://github.com/klaviyo/klaviyo-android-sdk#Tracking-Open-Events) +- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Tracking-Open-Events) + +#### Tracking Open Events +To track push notification opens, you must call `Klaviyo.handlePush(intent)` when your app is launched from an intent. +This method will check if the app was opened from a notification originating from Klaviyo and if so, create an +`Opened Push` event with required message tracking parameters. For example: + +#### Deep Linking +[Deep Links](https://help.klaviyo.com/hc/en-us/articles/14750403974043) allow you to navigate to a particular +page within your app in response to the user opening a notification. Familiarize yourself with the +[React Native Guide](https://reactnative.dev/docs/linking) to deep linking, then read through the platform-specific +instructions below. +- [Android](https://github.com/klaviyo/klaviyo-android-sdk#Deep-Linking) instructions for handling intent filters +- [iOS](https://github.com/klaviyo/klaviyo-swift-sdk#Deep-Linking) + As shown in the native SDK documentation, you can follow option 1 or 2. + With option 1, when you get the callback, you can handle it as follows: + + ```objective-c + [RCTLinkingManager application:application openURL:url options:options] + ``` + + Since you won't have `options`, you can just pass in an empty dictionary for that parameter. + + With option 2, when you handle the open url (in [`application(_:open:options)`](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application)), + you call the linking code block above similar to what you would do with option 1. + +In your React Native code, you can handle the deep link as follows: ```typescript import { Linking } from 'react-native'; @@ -211,15 +281,13 @@ Linking.getInitialURL().then((url) => { }); ``` -## Push Permissions - -It is recommended that handling push permissions be done from the native layer. On iOS, you can follow the [iOS](https://github.com/klaviyo/klaviyo-swift-sdk?tab=readme-ov-file#sending-push-notifications) guide on requesting permissions. On Android, you can follow the [Android](https://source.android.com/docs/core/display/notification-perm) guide on requesting permissions. - ## Contributing - -See the [contributing guide](.github/CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. +Refer to the [contributing guide](.github/CONTRIBUTING.md) to learn how to contribute to the Klaviyo React Native SDK. +We welcome your feedback in the [discussion](https://github.com/klaviyo/klaviyo-react-native-sdk/discussions) +and [issues](https://github.com/klaviyo/klaviyo-react-native-sdk/issues) sections of our public GitHub repository. ## License +The Klaviyo React Native SDK is available under the terms of the MIT license. See [LICENSE](./LICENSE) for more info. -## License -The Klaviyo React Native SDK is available under the MIT license. See [LICENSE](./LICENSE) for more info. +## Code Documentation +Browse complete autogenerated code documentation [here](https://klaviyo.github.io/klaviyo-react-native-sdk/). diff --git a/android/build.gradle b/android/build.gradle index 35aac48..1146662 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -103,15 +103,33 @@ repositories { } def kotlin_version = getExtOrDefault("kotlinVersion") +def localProperties = new Properties() +if (rootProject.file("local.properties").canRead()) { + localProperties.load(new FileInputStream(rootProject.file("local.properties"))) +} +def reactNativeVersion = localProperties['reactNativeAndroidVersion'] ?: "" + dependencies { - // For < 0.71, this will be from the local maven repo - // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin - //noinspection GradleDynamicVersion - implementation "com.facebook.react:react-android:0.73.1" + if (reactNativeVersion) { + // For local development of the SDK code, specify the react-android version to use + // So that the SDK can be built and .kt files are linted against a real version of react-native + implementation "com.facebook.react:react-android:$reactNativeVersion" + } else { + // Production build / once embedded in a react-native app, + // the react-native version gets loaded in from the application dependencies. + // For < 0.71, this will be from the local maven repo + // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin + //noinspection GradleDynamicVersion + implementation "com.facebook.react:react-native:+" + } implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + // Klaviyo Android SDK api "com.github.klaviyo.klaviyo-android-sdk:analytics:2.0.0" api "com.github.klaviyo.klaviyo-android-sdk:push-fcm:2.0.0" + + // We used reflection to enumerate keywords in the Klaviyo Android SDK dynamically implementation "org.jetbrains.kotlin:kotlin-reflect:1.8.21" } diff --git a/android/gradle.properties b/android/gradle.properties index b997206..e3ce6fc 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -12,7 +12,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # org.gradle.parallel=true #Tue Dec 19 15:08:27 EST 2023 KlaviyoReactNativeSdk_compileSdkVersion=31 -KlaviyoReactNativeSdk_kotlinVersion=1.7.0 +KlaviyoReactNativeSdk_kotlinVersion=1.8.0 KlaviyoReactNativeSdk_minSdkVersion=23 KlaviyoReactNativeSdk_ndkversion=21.4.7075529 KlaviyoReactNativeSdk_targetSdkVersion=31 diff --git a/android/local.properties b/android/local.properties new file mode 100644 index 0000000..509f9fd --- /dev/null +++ b/android/local.properties @@ -0,0 +1,7 @@ +## Changes in this file must *NOT* be tracked by Version Control Systems, +# as it contains information specific to your local configuration. +# Only the base template should be checked in to VCS. + +## Uncomment for local SDK development, so that gradle can locate the +# correct RN version outside the context of an application +#reactNativeAndroidVersion=0.73.1 diff --git a/android/src/main/java/com/klaviyoreactnativesdk/KlaviyoReactNativeSdkModule.kt b/android/src/main/java/com/klaviyoreactnativesdk/KlaviyoReactNativeSdkModule.kt index 01f36c9..7dcfd2a 100644 --- a/android/src/main/java/com/klaviyoreactnativesdk/KlaviyoReactNativeSdkModule.kt +++ b/android/src/main/java/com/klaviyoreactnativesdk/KlaviyoReactNativeSdkModule.kt @@ -49,7 +49,7 @@ class KlaviyoReactNativeSdkModule internal constructor(private val context: Reac override fun setProfile(profile: ReadableMap) { val parsedProfile = Profile() - profile.toHashMap().forEach { (key, value) -> + profile.toHashMap().iterator().forEach { (key, value) -> when (key) { LOCATION, PROPERTIES -> (value as? HashMap<*, *>)?.forEach { (key, value) -> diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index 6d44ef6..f2d959e 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -1,20 +1,20 @@ :root { - --light-hl-0: #795E26; - --dark-hl-0: #DCDCAA; - --light-hl-1: #000000; - --dark-hl-1: #D4D4D4; - --light-hl-2: #A31515; - --dark-hl-2: #CE9178; - --light-hl-3: #0070C1; - --dark-hl-3: #4FC1FF; - --light-hl-4: #AF00DB; - --dark-hl-4: #C586C0; - --light-hl-5: #267F99; - --dark-hl-5: #4EC9B0; - --light-hl-6: #0000FF; - --dark-hl-6: #569CD6; - --light-hl-7: #008000; - --dark-hl-7: #6A9955; + --light-hl-0: #008000; + --dark-hl-0: #6A9955; + --light-hl-1: #795E26; + --dark-hl-1: #DCDCAA; + --light-hl-2: #000000; + --dark-hl-2: #D4D4D4; + --light-hl-3: #A31515; + --dark-hl-3: #CE9178; + --light-hl-4: #0000FF; + --dark-hl-4: #569CD6; + --light-hl-5: #0070C1; + --dark-hl-5: #4FC1FF; + --light-hl-6: #AF00DB; + --dark-hl-6: #C586C0; + --light-hl-7: #267F99; + --dark-hl-7: #4EC9B0; --light-hl-8: #001080; --dark-hl-8: #9CDCFE; --light-hl-9: #098658; diff --git a/docs/enums/EventName.html b/docs/enums/EventName.html index 60b8629..5efcf67 100644 --- a/docs/enums/EventName.html +++ b/docs/enums/EventName.html @@ -1,10 +1,10 @@
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.
-