amplitude / amplitude/AmplitudeSessionReplay-Android

Android SDK integration docs are wrong/outdated

Offen
#7 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Keine Sprachdaten
Sterne
2
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I was following the setup docs for session tracking on Android [here](https://amplitude.com/docs/session-replay/session-replay-android-plugin)
This is the suggested code for basic setup of session tracking:
```
import com.amplitude.android.Amplitude
import com.amplitude.android.Configuration
import com.amplitude.android.plugins.SessionReplayPlugin

// Initialize Amplitude Analytics SDK instance
val amplitude = Amplitude(Configuration(
apiKey = API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(sessions = true),
))

// Create and Install Session Replay Plugin
// Recording will be handled automatically
val sessionReplayPlugin = SessionReplayPlugin(sampleRate = 1.0)
amplitude.add(sessionReplayPlugin)

// Send replay data to the server
amplitude.flush()
```

However `DefaultTrackingOptions` has been deprecated, the correct way seems to now be

```
val amplitude = Amplitude(
Configuration(
apiKey = apiKey,
context = context,
serverZone = ServerZone.EU,
autocapture = setOf(AutocaptureOption.SESSIONS)
)
)
val sessionReplayPlugin = SessionReplayPlugin(
sampleRate = 1.0
)
amplitude.add(sessionReplayPlugin)
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.