Skip to content

Commit b92a6d1

Browse files
authored
Merge pull request #3036 from segmentio/wenxi/fix-kotlin-outdated-info
fix kotlin outdated info
2 parents 06ab868 + ad4054c commit b92a6d1

File tree

2 files changed

+44
-8
lines changed
  • src/connections/sources/catalog/libraries

2 files changed

+44
-8
lines changed

src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ The Analytics-Kotlin utility methods help you work with plugins from the analyti
346346
- [Add](#add)
347347
- [Find](#find)
348348
- [Remove](#remove)
349+
- [Reset](#reset)
349350

350351
There's also the [Flush](#flush) method to help you manage the current queue of events.
351352

@@ -422,6 +423,23 @@ analytics.flush("SomePlugin")
422423
{% endcodeexampletab %}
423424
{% endcodeexample %}
424425

426+
### Reset
427+
The `reset` method clears the SDK’s internal stores for the current user and group. This is useful for apps where users log in and out with different identities on the same device over time.
428+
429+
{% codeexample %}
430+
{% codeexampletab Method signature %}
431+
```java
432+
fun reset()
433+
```
434+
{% endcodeexampletab %}
435+
436+
{% codeexampletab Example use %}
437+
```java
438+
analytics.reset()
439+
```
440+
{% endcodeexampletab %}
441+
{% endcodeexample %}
442+
425443
## Build Your Own Destination
426444

427445
If Segment doesn't support your Kotlin destination, you can build your own with the template Segment provides.

src/connections/sources/catalog/libraries/server/kotlin/index.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ To get started with the Analytics-Kotlin server library:
2222

2323
2. Add the Analytics dependency to your `build.gradle`.
2424

25-
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.
25+
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 `<latest_version>` with the latest version listed on Segment's [releases page](https://github.com/segmentio/analytics-kotlin/releases){:target="_blank"}.
2626

2727
```java
28-
repositories {
29-
maven { url 'https://jitpack.io' }
30-
}
31-
dependencies {
32-
implementation 'com.github.segmentio.analytics-kotlin:core:+'
33-
}
28+
repositories {
29+
mavenCentral()
30+
}
31+
dependencies {
32+
implementation 'com.segment.analytics.kotlin:core:<latest_version>'
33+
}
3434
```
3535
3. Initialize and configure the client.
3636

@@ -179,7 +179,7 @@ analytics.group("user-123", buildJsonObject {
179179
## Plugin Architecture
180180
Segment's plugin architecture enables you to modify and augment how the analytics client works. From modifying event payloads to changing analytics functionality, plugins help to speed up the process of getting things done.
181181

182-
Plugins are run through a timeline, which executes in order of insertion based on their entry types. Segment has these 5 entry types:
182+
Plugins are run through a timeline, which executes in order of insertion based on their entry types. Segment has these five entry types:
183183

184184
| Type | Details |
185185
| ------------- | ---------------------------------------------------------------------------------------------- |
@@ -319,6 +319,7 @@ The Analytics-Kotlin utility methods help you work with plugins from the analyti
319319
- [Add](#add)
320320
- [Find](#find)
321321
- [Remove](#remove)
322+
- [Reset](#reset)
322323

323324
There's also the [Flush](#flush) method to help you manage the current queue of events.
324325

@@ -395,6 +396,23 @@ analytics.flush("SomePlugin")
395396
{% endcodeexampletab %}
396397
{% endcodeexample %}
397398

399+
### Reset
400+
The `reset` method clears the SDK’s internal stores for the current user and group. This is useful for apps where users log in and out with different identities on the same device over time.
401+
402+
{% codeexample %}
403+
{% codeexampletab Method signature %}
404+
```java
405+
fun reset()
406+
```
407+
{% endcodeexampletab %}
408+
409+
{% codeexampletab Example use %}
410+
```java
411+
analytics.reset()
412+
```
413+
{% endcodeexampletab %}
414+
{% endcodeexample %}
415+
398416

399417
## Changelog
400418
[View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases).

0 commit comments

Comments
 (0)