From 088374c7479d01aef3237412eac092a5dd68ebc2 Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Tue, 7 Dec 2021 09:03:39 -0800 Subject: [PATCH 1/9] kotlin issue and compatibility fix --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index 5d0ae2ce85..d0bb543f2d 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -67,7 +67,7 @@ To get started with the Analytics-Kotlin mobile library: `flushAt` | Default set to `20`.
The count of events at which Segment flushes events. | `flushInterval` | Default set to `30` (seconds).
The interval in seconds at which Segment flushes events. | `recordScreenViews` | Default set to `false`.
Set to `true` to automatically trigger screen events on Activity Start. | - `storageProvider` | Default set to `ConcreteStorageProvider`.
The provider for storage class. It’s best not to modify this as it can disrupt your storage logic and you won’t be able to correctly store events. | + `storageProvider` | Default set to `ConcreteStorageProvider`.
The provider for storage class. It’s best not to modify this as it can disrupt your storage logic and you won’t be able to correctly store events.
NOTE: in Android, if you create `Configuration` through constrcutor, this must be set to `AndroidStorageProvider`.| `trackApplicationLifecycleEvents` | Default set to `false`.
Set to `true` to automatically track Lifecycle events. | `trackDeepLinks` | Default set to `false`.
Set to `true` to automatically track opened Deep Links based on intents. | `useLifecycleObserver` | Default set to `false`.
Set to `true` to use `LifecycleObserver` to track Application lifecycle events. | @@ -442,3 +442,6 @@ Segment recommends you to test your destination implementation end-to-end. Send ## Changelog [View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases). + +## Compatibility +[View the Analytics-Kotlin compatibility notes on GitHub](https://github.com/segmentio/analytics-kotlin#compatibility). From cf65725bcb63362382ee7b17c80fad3de9bb8919 Mon Sep 17 00:00:00 2001 From: forstisabella <92472883+forstisabella@users.noreply.github.com> Date: Wed, 8 Dec 2021 09:20:45 -0500 Subject: [PATCH 2/9] Fixing spelling error --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index d0bb543f2d..3561119287 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -67,7 +67,7 @@ To get started with the Analytics-Kotlin mobile library: `flushAt` | Default set to `20`.
The count of events at which Segment flushes events. | `flushInterval` | Default set to `30` (seconds).
The interval in seconds at which Segment flushes events. | `recordScreenViews` | Default set to `false`.
Set to `true` to automatically trigger screen events on Activity Start. | - `storageProvider` | Default set to `ConcreteStorageProvider`.
The provider for storage class. It’s best not to modify this as it can disrupt your storage logic and you won’t be able to correctly store events.
NOTE: in Android, if you create `Configuration` through constrcutor, this must be set to `AndroidStorageProvider`.| + `storageProvider` | Default set to `ConcreteStorageProvider`.
The provider for storage class. It’s best not to modify this as it can disrupt your storage logic and you won’t be able to correctly store events.
NOTE: in Android, if you create `Configuration` through a constructor, this must be set to `AndroidStorageProvider`.| `trackApplicationLifecycleEvents` | Default set to `false`.
Set to `true` to automatically track Lifecycle events. | `trackDeepLinks` | Default set to `false`.
Set to `true` to automatically track opened Deep Links based on intents. | `useLifecycleObserver` | Default set to `false`.
Set to `true` to use `LifecycleObserver` to track Application lifecycle events. | From 8bc7ce3f8974d33847e000e7e6f9f3b928ac5907 Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Thu, 16 Dec 2021 14:43:50 -0800 Subject: [PATCH 3/9] fix misleading description on storage provider --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index 3561119287..f92a5b4174 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -42,6 +42,7 @@ To get started with the Analytics-Kotlin mobile library: ```java // Create an analytics client with the given application context and Segment write key. + // NOTE: in android, application context is required to pass as the second parameter. Analytics("YOUR_WRITE_KEY", applicationContext) { // Automatically track Lifecycle events trackApplicationLifecycleEvents = true @@ -67,7 +68,7 @@ To get started with the Analytics-Kotlin mobile library: `flushAt` | Default set to `20`.
The count of events at which Segment flushes events. | `flushInterval` | Default set to `30` (seconds).
The interval in seconds at which Segment flushes events. | `recordScreenViews` | Default set to `false`.
Set to `true` to automatically trigger screen events on Activity Start. | - `storageProvider` | Default set to `ConcreteStorageProvider`.
The provider for storage class. It’s best not to modify this as it can disrupt your storage logic and you won’t be able to correctly store events.
NOTE: in Android, if you create `Configuration` through a constructor, this must be set to `AndroidStorageProvider`.| + `storageProvider` | Default set to `ConcreteStorageProvider`.
In Android, this must be set to `AndroidStorageProvider`. The `Analytics` constructors configure this automatically. | `trackApplicationLifecycleEvents` | Default set to `false`.
Set to `true` to automatically track Lifecycle events. | `trackDeepLinks` | Default set to `false`.
Set to `true` to automatically track opened Deep Links based on intents. | `useLifecycleObserver` | Default set to `false`.
Set to `true` to use `LifecycleObserver` to track Application lifecycle events. | From f2021721fe3d4fd2a6fd007b87b26e7beaa8c492 Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Thu, 16 Dec 2021 15:05:18 -0800 Subject: [PATCH 4/9] replace jitpack with maven --- .../catalog/libraries/mobile/kotlin-android/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index f92a5b4174..8e2cf50d36 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -25,14 +25,14 @@ To get started with the Analytics-Kotlin mobile library: 2. Search for **Kotlin (Android)** and click **Add source**. 2. Add the Analytics dependency to your build.gradle. - Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Jitpack](https://jitpack.io/){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below. + Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `` with the latest version listed in [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"} ``` repositories { - maven { url 'https://jitpack.io' } + mavenCentral() } dependencies { - implementation 'com.github.segmentio.analytics-kotlin:android:+' + implementation 'com.segment.analytics.kotlin:android:' } ``` From a4766e44684d4fe37846c164179cb151dd95725e Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Wed, 12 Jan 2022 13:31:27 -0800 Subject: [PATCH 5/9] remove unnecessary permission --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index 8e2cf50d36..2587e866f3 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -81,8 +81,6 @@ To get started with the Analytics-Kotlin mobile library: - - ``` ## Tracking Methods From 3de5eb12c2f55c622a6494de1886c8f9f577b03e Mon Sep 17 00:00:00 2001 From: Wenxi Zeng Date: Wed, 12 Jan 2022 15:03:09 -0800 Subject: [PATCH 6/9] update the doc with the latest sdk setup --- .../libraries/mobile/kotlin-android/index.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index 2587e866f3..baa53e988a 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -25,7 +25,7 @@ To get started with the Analytics-Kotlin mobile library: 2. Search for **Kotlin (Android)** and click **Add source**. 2. Add the Analytics dependency to your build.gradle. - Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `` with the latest version listed in [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"} + Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://repo1.maven.org/maven2/com/segment/analytics/kotlin/android/){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `` with the latest version listed in our [releases page](https://github.com/segmentio/analytics-kotlin/releases){:target="_blank"} ``` repositories { @@ -51,6 +51,9 @@ To get started with the Analytics-Kotlin mobile library: } ``` + > warning "" + > **Note:** In android, application context is required to pass as the second parameter, or an error `Using JVM Analytics initializer in Android platform. Context is required in constructor!` will be thrown out. + Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) is optional, but Segment highly recommends you to configure these options in order to track core events.
**Note:** Unlike the Analytics-Android SDK, the Analytics-Kotlin SDK doesn’t provide a singleton instance and relies on you to keep track of the instance. @@ -83,6 +86,12 @@ To get started with the Analytics-Kotlin mobile library: ``` +5. Enable Java 8+ API desugaring + + The SDK internally uses a number of Java 8 language APIs through desugaring. Please make sure your project: + * either enables desugaring (see how to enable it [here](https://developer.android.com/studio/write/java8-support#library-desugaring)) + * or requires a minimum API level of 26. + ## Tracking Methods Once you’ve installed the mobile or server Analytics-Kotlin library, you can start collecting data through Segment’s tracking methods: @@ -439,8 +448,8 @@ To test your destination: Segment recommends you to test your destination implementation end-to-end. Send some sample analytics events and ensure that they reach the destination. -## Changelog -[View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases). - ## Compatibility [View the Analytics-Kotlin compatibility notes on GitHub](https://github.com/segmentio/analytics-kotlin#compatibility). + +## Changelog +[View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases). From 81e257f4cf25fe8808de54fb6ba7c977cd39ec6a Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:40:17 -0800 Subject: [PATCH 7/9] Apply suggestions from code review --- .../libraries/mobile/kotlin-android/index.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index baa53e988a..4eeaee0df6 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -25,7 +25,7 @@ To get started with the Analytics-Kotlin mobile library: 2. Search for **Kotlin (Android)** and click **Add source**. 2. Add the Analytics dependency to your build.gradle. - Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://repo1.maven.org/maven2/com/segment/analytics/kotlin/android/){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `` with the latest version listed in our [releases page](https://github.com/segmentio/analytics-kotlin/releases){:target="_blank"} + Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://repo1.maven.org/maven2/com/segment/analytics/kotlin/android/){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `` with the latest version listed on Segment's [releases page](https://github.com/segmentio/analytics-kotlin/releases){:target="_blank"} ``` repositories { @@ -51,10 +51,8 @@ To get started with the Analytics-Kotlin mobile library: } ``` - > warning "" - > **Note:** In android, application context is required to pass as the second parameter, or an error `Using JVM Analytics initializer in Android platform. Context is required in constructor!` will be thrown out. - - Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) is optional, but Segment highly recommends you to configure these options in order to track core events. + **Note:** If you're on an Android platform, you must add the application context as the second parameter. +
Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) is optional, but Segment highly recommends you to configure these options in order to track core events.
**Note:** Unlike the Analytics-Android SDK, the Analytics-Kotlin SDK doesn’t provide a singleton instance and relies on you to keep track of the instance. @@ -86,11 +84,9 @@ To get started with the Analytics-Kotlin mobile library: ``` -5. Enable Java 8+ API desugaring +5. Enable Java 8+ API desugaring. - The SDK internally uses a number of Java 8 language APIs through desugaring. Please make sure your project: - * either enables desugaring (see how to enable it [here](https://developer.android.com/studio/write/java8-support#library-desugaring)) - * or requires a minimum API level of 26. + The SDK internally uses a number of Java 8 language APIs through desugaring. Make sure your project either [enables desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring)) or requires a minimum API level of 26. ## Tracking Methods From cbbce18bc36e538e0c7e30d5fe78f9e209d9168a Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Thu, 13 Jan 2022 09:04:25 -0800 Subject: [PATCH 8/9] Apply suggestions from code review --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index 4eeaee0df6..db28390d48 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -51,7 +51,7 @@ To get started with the Analytics-Kotlin mobile library: } ``` - **Note:** If you're on an Android platform, you must add the application context as the second parameter. + **Note: If you're on an Android platform, you must add the application context as the second parameter.**
Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) is optional, but Segment highly recommends you to configure these options in order to track core events.
**Note:** Unlike the Analytics-Android SDK, the Analytics-Kotlin SDK doesn’t provide a singleton instance and relies on you to keep track of the instance. @@ -445,7 +445,7 @@ To test your destination: Segment recommends you to test your destination implementation end-to-end. Send some sample analytics events and ensure that they reach the destination. ## Compatibility -[View the Analytics-Kotlin compatibility notes on GitHub](https://github.com/segmentio/analytics-kotlin#compatibility). +If you use a pure Java codebase, please refer to [Java Compatibility](https://github.com/segmentio/analytics-kotlin/blob/main/JAVA_COMPAT.md){:target="_blank"} for sample uses. ## Changelog [View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases). From 3bb1e1913b056677ddb891b49fe864dea4b454c0 Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Thu, 13 Jan 2022 09:09:16 -0800 Subject: [PATCH 9/9] Apply suggestions from code review --- .../sources/catalog/libraries/mobile/kotlin-android/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md index db28390d48..97947c453a 100644 --- a/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md +++ b/src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md @@ -445,7 +445,7 @@ To test your destination: Segment recommends you to test your destination implementation end-to-end. Send some sample analytics events and ensure that they reach the destination. ## Compatibility -If you use a pure Java codebase, please refer to [Java Compatibility](https://github.com/segmentio/analytics-kotlin/blob/main/JAVA_COMPAT.md){:target="_blank"} for sample uses. +If you use a Java codebase, please refer to the [Java Compatibility docs](https://github.com/segmentio/analytics-kotlin/blob/main/JAVA_COMPAT.md){:target="_blank"} for sample uses. ## Changelog [View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases).