Smart Walking
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
iOS: connectAppleHealthKit — performs registration + HealthKit permission flow.
Android: connectGoogleHealthConnect — performs registration + Health Connect permission flow.
Other flows
registerUser — register another device or re-register a new device (e.g., device change).
getRegisteredProfile — fetch current SmartWalking status from the server.
getDailyStepGoal — fetch daily step goal from the server.
getDatesToSync, submitActivities, syncSteps — periodic data sync.
unregisterUser — revoke scopes and mark SmartWalking as not configured.
Platform & threading
All suspend functions must be called from a coroutine.
Errors surface as
Throwableand should be handled at call sites.
Functions
iOS primary flow — connects Apple HealthKit and performs registration + permissions.
Connects Fitbit to the member’s SmartWalking profile (OAuth-based).
Android primary flow — connects Google Health Connect and performs registration + permissions.
Fetches the list of dates that require synchronization.
Retrieves the current SmartWalking profile/status from the server.
Registers the member with SmartWalking for another device or re-registers a new device.
Submits a batch of health activities to SmartWalking.
Unregisters the member from SmartWalking and revokes granted scopes.