Movement Health
Movement Health connects members to movr, a partner experience with guided routines and short movement exercises ("movement snacks") through the day. AFCore links the member to movr and reports the sessions they complete, which then appear in the member's activity history; the routines themselves come from the movr SDK, which your app embeds alongside AFCore. Requires Movement Health to be enabled for your client.
What you can do
- Check whether the member already has a movr profile.
- Link the member to movr and get the id your app configures the movr SDK with.
- Report completed sessions so they count toward the member's activity.
Key APIs
| Call | What it is for |
|---|---|
isMovrProfileRegistered() | Whether the member is already linked to movr |
registerMovrProfile() | Links the member and returns their movr id |
submitMovrSessions(sessions) | Reports the sessions the member completed |
Example: link the member and report sessions
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
try {
// Links the member; calling it again returns the same id
val movrId = AFCore.movementHealth().registerMovrProfile()
if (movrId != null) startMovrSdk(userId = movrId) else showUnavailable()
// Later, when the movr SDK reports completed sessions
val result = AFCore.movementHealth().submitMovrSessions(sessions = completedCount)
if (!result.status) showError(result.statusMessage)
} catch (t: Throwable) {
showError(t)
}
}
Task {
do {
// Links the member; calling it again returns the same id
if let movrId = try await AFCore.shared.movementHealth().registerMovrProfile() {
startMovrSdk(userId: movrId)
} else {
showUnavailable()
}
// Later, when the movr SDK reports completed sessions
let result = try await AFCore.shared.movementHealth().submitMovrSessions(
sessions: Int32(completedCount)
)
if !result.status { showError(result.statusMessage) }
} catch {
showError(error)
}
}
Learn more
- API Reference -- every Movement Health call and model.
- Complete integration guides for Movement Health and the movr SDK are in AIDE Docs.