submitMovrSessions

abstract suspend fun submitMovrSessions(sessions: Int): AFResult

Submits the number of Movr sessions completed by the user.

⚠️ Disclaimer: This function should only be called after obtaining the total session count from the official Movr SDK. That SDK must be installed separately and integrated into your application to track and calculate performed sessions. AFCore does not calculate session totals itself.

Return

true if sessions were submitted successfully; false otherwise.

Parameters

sessions

The number of Movr sessions to record (as reported by the Movr SDK).

Throws

if submission fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val ok = AFCore.movementHealth().submitMovrSessions(sessions = totalFromMovrSdk)
if (ok) showMessage("Sessions submitted") else showError("Submit failed")
} catch (t: Throwable) {
showError("Submit failed: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let ok = try await AFCore.shared.movementHealth().submitMovrSessions(sessions: totalFromMovrSdk)
ok ? self.showMessage("Sessions submitted")
: self.showError("Submit failed")
} catch {
self.showError("Submit failed: \\(error.localizedDescription)")
}
}