SmartWalking

interface SmartWalking

SmartWalking feature — manage health device connections and data synchronization.

SmartWalking connects external health platforms (Apple HealthKit, Google Health Connect, Fitbit) with the member’s Advanta profile, and synchronizes steps, calories, distance, and other activity data.

⚠️ Disclaimer

  • SmartWalking integrations rely on external health platform apps:

  • iOS: Apple Health (Health app)

  • Android: Google Health Connect

  • Fitbit: Fitbit app + OAuth

  • Ensure the corresponding app is installed and the platform is configured on the device.

Most important flows

Other flows

Platform & threading

  • All suspend functions must be called from a coroutine.

  • Errors surface as Throwable and should be handled at call sites.

Functions

Link copied to clipboard
abstract suspend fun connectAppleHealthKit(deviceId: String): SmartWalkingProfile

iOS primary flow — connects Apple HealthKit and performs registration + permissions.

Link copied to clipboard
abstract suspend fun connectFitbit()

Connects Fitbit to the member’s SmartWalking profile (OAuth-based).

Link copied to clipboard
abstract suspend fun connectGoogleHealthConnect(context: Any, deviceId: String): SmartWalkingProfile

Android primary flow — connects Google Health Connect and performs registration + permissions.

Link copied to clipboard
abstract suspend fun getDailyStepGoal(): Int
Link copied to clipboard
abstract suspend fun getDatesToSync(): List<LocalDate>

Fetches the list of dates that require synchronization.

Link copied to clipboard
abstract suspend fun getRegisteredProfile(): SmartWalkingProfile?

Retrieves the current SmartWalking profile/status from the server.

Link copied to clipboard
abstract suspend fun registerUser(deviceId: String, deviceType: DeviceType): SmartWalkingProfile

Registers the member with SmartWalking for another device or re-registers a new device.

Link copied to clipboard
abstract suspend fun submitActivities(activities: List<HealthData>): AFResult

Submits a batch of health activities to SmartWalking.

Link copied to clipboard
abstract suspend fun syncSteps(): AFResult

Synchronizes health data (steps, calories, distance, etc.) with SmartWalking.

Link copied to clipboard
abstract suspend fun unregisterUser(): Boolean

Unregisters the member from SmartWalking and revokes granted scopes.