Skip to main content

Fit@Home

Fit@Home lets a member earn credit for an at-home workout by submitting a selfie. Your app shows the camera and captures the image as a JPEG (or PNG); the SDK uploads it for review, and the workout appears in the member's activity history.

What you can do​

  • Submit a selfie for today's workout, with an optional location.
  • Delete a pending selfie so the member can retake it.
  • Keep the one-selfie-per-day rule: a day holds one selfie whatever its status. Only a pending selfie can be deleted and retaken.

If the device has no connection when the member submits, the SDK keeps the selfie and uploads it automatically once the connection returns; the result tells you so, and you do not retry it yourself. A selfie that is empty or not a JPEG or PNG fails right away, online or offline, with a message you can show.

Key APIs​

CallWhat it is for
fitAtHome().submitSelfie(...)Submit the workout selfie
fitAtHome().deleteSelfie(date)Delete the selfie for a day
AFPermissions.requestPermission(Permission.CAMERA)Ask for the camera before capturing

Example​

lifecycleScope.launch {
val result = AFCore.fitAtHome().submitSelfie(
media = selfieBytes, // the captured JPEG
timestampInSeconds = Clock.System.now().epochSeconds,
lat = null,
lng = null
)
when {
result.queued -> showMessage("No connection - your workout will upload automatically")
result.status -> showSuccess("Workout submitted")
else -> showError(result.statusMessage)
}
}

UI Reference​

Present a camera viewfinder with a face guide and a capture button, then a preview so the member can retake before uploading.

Selfie capture UI showing iOS (Apple HIG) and Android (Material Design 3) implementations with camera viewfinder, face guide overlay, and capture button

Learn more​

  • API Reference for fitAtHome().
  • Complete integration guides, including camera capture, are in AIDE Docs.