Skip to content

Commit 82cf000

Browse files
author
Niall Brennan
committed
Add reset info for new libraries
1 parent 60b00e4 commit 82cf000

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

src/_includes/content/reset-mobile.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="premonition info">
2+
<div class="fa fa-info-circle"></div>
3+
<div class="content">
4+
<p>The reset method does not clear the userId from connected client side integrations. If you wish to clear the userId from connected client side destination plugins, you would need to call the equivalent reset method for that library.</p>
5+
</div>
6+
</div>

src/connections/sources/catalog/libraries/mobile/apple/implementation.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ The Analytics Swift utility methods help you work with [plugins](#plugin-archite
205205
- [Add](#add)
206206
- [Find](#find)
207207
- [Remove](#remove)
208+
- [Reset](#reset)
208209
209210
There's also the [Flush](#flush) method to help you manage the current queue of events.
210211
@@ -276,6 +277,25 @@ analytics.flush()
276277
{% endcodeexampletab %}
277278
{% endcodeexample %}
278279

280+
### Reset
281+
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.
282+
283+
{% codeexample %}
284+
{% codeexampletab Method signature %}
285+
```swift
286+
public func reset()
287+
```
288+
{% endcodeexampletab %}
289+
290+
{% codeexampletab Example use %}
291+
```swift
292+
analytics.reset()
293+
```
294+
{% endcodeexampletab %}
295+
{% endcodeexample %}
296+
297+
{% include content/reset-mobile.md %}
298+
279299
### OpenURL
280300

281301
Since there a various deep linking scenarios you may want to account for, the `analytics.openURL(...)` method was added so you can track deep links in any situation. Where and how you implement the method will depend on your app lifecycle setup (for example UIApplicationDelegate vs. UISceneDelegate or UIKit vs. SwiftUI). The snippets below outline what your implementation might look like in a few different scenarios.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ analytics.reset()
257257
{% endcodeexampletab %}
258258
{% endcodeexample %}
259259
260+
{% include content/reset-mobile.md %}
260261
261262
### OpenURL
262263
While Analytics Kotlin will automatically track deep links that open your app when the `trackDeepLinks` Configuration property is set to `true`. There are some situations when the app is already open that could cause a deep link open event to be missed.

src/connections/sources/catalog/libraries/mobile/react-native/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ reset();
291291
{% endcodeexampletab %}
292292
{% endcodeexample %}
293293
294+
{% include content/reset-mobile.md %}
295+
294296
### Flush
295297
By default, the analytics client sends queued events to the API every 30 seconds or when 20 events accumulate, whichever occurs first. This also occurs whenever the app resumes if the user has closed the app with some events unsent. These values can be modified by the `flushAt` and `flushInterval` config options. You can also trigger a flush event manually.
296298

0 commit comments

Comments
 (0)