getRegisteredProfile

abstract suspend fun getRegisteredProfile(): SmartWalkingProfile?

Fetches the member’s current SmartWalking profile from the server.

The profile indicates whether SmartWalking is connected, which device type is registered, and when the registration was created. This call also updates local preferences (smartWalkingConnected, smartWalkingId, smartWalkingDeviceType) to keep them in sync with the server.

Returns null if no member ID is available (not logged in) or if the server returns a null/empty profile. Does not throw on network errors — returns null and logs the error instead.

Kotlin

lifecycleScope.launch {
val profile = AFCore.smartWalking().getRegisteredProfile()
if (profile != null && profile.isConnected) {
showMessage("SmartWalking connected via ${profile.registeredDeviceType}")
} else {
showSetupPrompt()
}
}

Swift

Task {
if let profile = try await AFCore.shared.smartWalking().getRegisteredProfile(),
profile.isConnected {
showMessage("SmartWalking connected via \(profile.registeredDeviceType)")
} else {
showSetupPrompt()
}
}

Return

The SmartWalkingProfile from the server, or null if unavailable.