deleteSelfie

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.

Return

An AFResult: status == true when the selfie was deleted; otherwise status == false with the server's reason in statusMessage.

Parameters

date

The date of the selfie to delete, formatted as yyyy-MM-dd.

Throws

if deletion fails.

Android (Kotlin)

lifecycleScope.launch {
val result = AFCore.fitAtHome().deleteSelfie("2025-08-22")
if (result.status) showMessage("Selfie deleted") else showError(result.statusMessage ?: "Delete failed")
}

iOS (Swift)

Task {
do {
let result = try await AFCore.shared.fitAtHome().deleteSelfie(date: "2025-08-22")
result.status ? showMessage("Selfie deleted") : showError(result.statusMessage ?? "Delete failed")
} catch {
showError(error.localizedDescription)
}
}