registerMovrProfile

abstract suspend fun registerMovrProfile(): String?

Registers a Movr profile for the current user and returns the member's Movr external id.

Typically called after isMovrProfileRegistered returns false. Registering an already-registered profile is safe and simply resolves with the existing id.

Keep the id. It is the user identifier the third-party MOVR SDK is configured with, and it is available nowhere else in AFCore — MemberProfile carries the Advanta member id, not this one. Persist it alongside the member's session; without it the host app can only hand the MOVR SDK an empty configuration and Movement Health cannot open.

Return

The Movr external id, or null when the backend accepted the call but registered no usable profile (no id, or a non-registered status).

Throws

if registration fails. A failure is never reported as null — null means the server answered and had no id to give.

Android (Kotlin)

lifecycleScope.launch {
try {
val externalId = AFCore.movementHealth().registerMovrProfile()
if (externalId != null) {
startMovrSdk(userId = externalId)
} else {
showError("Movr registration failed")
}
} catch (t: Throwable) {
showError("Could not register Movr profile: ${t.message}")
}
}

iOS (Swift)

Task {
do {
if let externalId = try await AFCore.shared.movementHealth().registerMovrProfile() {
self.startMovrSdk(userId: externalId)
} else {
self.showError("Movr registration failed")
}
} catch {
self.showError("Could not register Movr profile: \\(error.localizedDescription)")
}
}