FitAtHome

interface FitAtHome

Fit@Home feature — manage selfie submissions for at-home workouts.

This interface provides operations to submit and delete Fit@Home selfies. Implementations connect to backend services; developers only need to call these methods to interact with the feature.

Capabilities

  • Submit: upload a selfie taken during an at-home session; falls back to the offline outbox automatically when there is no connection.

  • Delete: remove a pending selfie by date, so the member can retake it.

Platform & threading

  • All functions are suspend and must be called from a coroutine.

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

Typical flows

  • During workout: call submitSelfie when the user takes a selfie.

  • Retaking: a member has one selfie per day; while it is pending, call deleteSelfie for that date before submitting another.

Functions

Link copied to clipboard
abstract suspend fun deleteSelfie(date: String): AFResult

Deletes the member's Fit@Home selfie for a date, so they can take another. Offer it only for a pending selfie: a reviewed one stays on the member's record.

Link copied to clipboard
abstract suspend fun submitSelfie(media: ByteArray, timestampInSeconds: Long, lat: Double?, lng: Double?): AFResult

Submits a Fit@Home selfie for the current member.