Skip to main content

Self-Report

Self-Report allows members to manually log facility visits when automatic detection (geofencing or beacon proximity) was not possible -- for example, when the member forgot to enable location services or visited a facility without beacons.


Data Model

SelfReportData

Returned by get(), this contains the member's facilities eligible for self-reporting and their past self-report history.

FieldTypeDescription
facilitiesList<Facility>Facilities the member can self-report against.
selfReportMonthsList<SelfReportMonth>Monthly breakdown of past self-reports.
statusMessageString?Optional server message (e.g., daily limit reached).

Get Self-Report Data

Retrieve the member's eligible facilities and self-report history.

lifecycleScope.launch {
val data = AFCore.selfReport().get()
val facilities = data.facilities
val history = data.selfReportMonths
// Populate a facility picker and display past reports
}

Submit a Self-Report

Log a manual visit for a specific facility.

Parameters

ParameterTypeRequiredDescription
facilityIdIntYesThe facility where the visit occurred.
timestampInSecondsLongYesUTC epoch timestamp of the visit.
timeSpentInMinutesIntYesDuration of the visit in minutes.
latitudeDouble?NoDevice latitude at time of report.
longitudeDouble?NoDevice longitude at time of report.
atFacilityBooleanNoWhether the member is currently at the facility (default false).
lifecycleScope.launch {
val result = AFCore.selfReport().submit(
facilityId = 42,
timestampInSeconds = System.currentTimeMillis() / 1000,
timeSpentInMinutes = 60,
latitude = 32.7157,
longitude = -117.1611,
atFacility = true
)

if (result.status) {
showSuccess("Visit reported successfully")
} else {
showError("Could not submit report: ${result.statusMessage}")
}
}

Delete a Self-Report

Remove a previously submitted self-report for a given date.

val result = AFCore.selfReport().delete("2026-02-13")
if (result.status) {
showSuccess("Report deleted")
}

Best Practices

  • Confirm before submitting. Show a confirmation dialog with the facility name, date, and duration before calling submit.
  • Distinguish manual from automatic visits in the UI. Use different icons or labels so members understand which visits were detected automatically and which were self-reported.
  • Respect server-side limits. Some organizations limit the number of self-reports per day or month. Check statusMessage for guidance.

Quick Reference

AFCore.selfReport().get()
AFCore.selfReport().submit(facilityId, timestampInSeconds, timeSpentInMinutes, lat, lng, atFacility)
AFCore.selfReport().delete(date)