Skip to main content

Movement Health

The Movement Health module integrates with movr, a partner SDK that provides guided routines and short movement exercises ("movement snacks") throughout the day. AFCore handles registration and session submission; the movr SDK must also be installed in your app to deliver the actual movement content.


How It Works

  1. Check registration -- Call isMovrProfileRegistered() to determine if the member is already linked to movr.
  2. Register -- If not registered, call registerMovrProfile() to create the association.
  3. Submit sessions -- After the member completes routines in movr, call submitMovrSessions() to report the count to the server. Completed sessions appear in the member's Activities history.

Check Registration Status

lifecycleScope.launch {
val registered = AFCore.movementHealth().isMovrProfileRegistered()
if (registered) {
showMovrContent()
} else {
showRegistrationPrompt()
}
}

Register

Link the member's account with movr. Call this once during onboarding or when the member first accesses Movement Health.

lifecycleScope.launch {
val success = AFCore.movementHealth().registerMovrProfile()
if (success) {
showSuccess("Movement Health activated")
showMovrContent()
} else {
showError("Could not activate Movement Health")
}
}

Submit Sessions

Report completed movement sessions to the server. Call this after the member finishes routines in the movr SDK.

Parameters

ParameterTypeRequiredDescription
sessionsIntYesNumber of completed sessions to report.
lifecycleScope.launch {
val result = AFCore.movementHealth().submitMovrSessions(sessions = completedCount)
if (result.status) {
showSuccess("$completedCount sessions recorded")
} else {
showError("Could not submit sessions: ${result.statusMessage}")
}
}

Best Practices

  • Prompt registration on first access. Check isMovrProfileRegistered() and show a clear onboarding screen explaining what Movement Health provides.
  • The movr SDK is required. AFCore only handles registration and session reporting. The movr SDK delivers the actual movement routines. Ensure it is installed and initialized in your app.
  • Submit sessions promptly. Report completed sessions as soon as the member finishes, rather than batching, so their activity history stays current.
  • Show progress. Use streaks, progress rings, or daily summaries to keep members engaged with their movement goals.

Quick Reference

// Android
AFCore.movementHealth().isMovrProfileRegistered()
AFCore.movementHealth().registerMovrProfile()
AFCore.movementHealth().submitMovrSessions(sessions)