Skip to main content

SmartWalking

SmartWalking turns the member's daily steps into program credit. It connects the device's health platform, Apple HealthKit on iOS or Google Health Connect on Android, and sends steps, distance, calories and active minutes to ActiveFit+. Each day the member reaches their step goal counts as a qualifying activity.

What you can do​

  • Connect the member's health platform in one call: it shows the system permission sheet, registers the device and turns on background sync.
  • Let the SDK sync steps in the background, across app restarts and reboots, or sync on demand from a button.
  • Show a sync indicator from the SDK's sync events.
  • Build a step dashboard: today's steps against the daily goal, plus distance, calories, active minutes and week or month charts from the member's activity history.
  • Disconnect the member when they no longer want to share steps.

Key APIs​

CallWhat it is for
smartWalking().getRegisteredProfile()Whether the member is already connected
smartWalking().connectGoogleHealthConnect(context, deviceId) / connectAppleHealthKit(deviceId)Connect the health platform
smartWalking().syncSteps()Sync now
smartWalking().subscribeToEvents()Sync started, finished or failed
smartWalking().getDailyStepGoal()The member's daily step goal
activities().get(month, year)Step totals per day for the dashboard
smartWalking().unregisterUser()Disconnect

Example​

lifecycleScope.launch {
val profile = AFCore.smartWalking().getRegisteredProfile()
if (profile?.isConnected != true) {
// Health Connect permission sheet, device registration and background sync in one call
AFCore.smartWalking().connectGoogleHealthConnect(context = activity, deviceId = installId)
}

val goal = AFCore.smartWalking().getDailyStepGoal()
val result = AFCore.smartWalking().syncSteps() // optional: background sync runs on its own
showDashboard(goal, synced = result.status)
}

UI Reference​

Show a connect screen while the member is not linked, then the step dashboard once they are.

SmartWalking connection flow showing the before state (connect button) transitioning to the after state (step dashboard with progress ring)

Once connected, a progress ring shows today's steps against the goal, with distance, calories, active minutes and a sync button.

Step progress ring showing iOS (Apple HIG) and Android (Material Design 3) implementations with daily step count, distance, calories, and active minutes

Learn more​

  • API Reference for smartWalking() and its events.
  • Complete integration guides, including platform setup and background sync, are in AIDE Docs.