Self-Report
Self-Report lets a member log a gym visit by hand when automatic detection could not record it, for example when location was off or they forgot their phone. The report goes to review and appears in the member's activity history as pending until it is approved or rejected.
What you can do
- Load the gyms the member can report against, together with their past reports.
- Submit a visit with its date and how long the member stayed.
- Delete a report that is still pending.
- Keep the one-report-per-day rule: a day that already has an approved visit, or a pending self-report, cannot take another one. A day with only SmartWalking steps stays open.
If the device has no connection when the member submits, the SDK keeps the report and uploads it automatically once the connection returns; the result tells you so, and you do not retry it yourself.
Key APIs
| Call | What it is for |
|---|---|
selfReport().get() | Gyms the member can report against, plus their report history |
selfReport().submit(...) | Report a visit |
selfReport().delete(date) | Delete a pending report for a day |
Example
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
val result = AFCore.selfReport().submit(
facilityId = 42,
timestampInSeconds = visitStart.epochSeconds,
timeSpentInMinutes = 60
)
when {
result.queued -> showMessage("No connection - your visit will upload automatically")
result.status -> showSuccess("Visit reported")
else -> showError(result.statusMessage)
}
}
let result = try await AFCore.shared.selfReport().submit(
facilityId: 42,
timestampInSeconds: Int64(visitStart.timeIntervalSince1970),
timeSpentInMinutes: 60,
latitude: nil,
longitude: nil,
atFacility: false
)
if result.queued {
showMessage("No connection - your visit will upload automatically")
} else if result.status {
showSuccess("Visit reported")
} else {
showError(result.statusMessage)
}
Learn more
- API Reference for
selfReport()and its models. - Complete integration guides, including a self-report calendar, are in AIDE Docs.