submit Barcode Id
Submits a scanned barcode value for the signed-in member.
Return
An AFResult; queued = true when the submission was deferred to the offline outbox rather than sent immediately.
Parameters
id
The decoded barcode payload from your scanner.
lat
Latitude where the scan occurred, or null if unavailable.
lng
Longitude where the scan occurred, or null if unavailable.
Throws
if the submission fails for a non-recoverable reason.
Android (Kotlin)
lifecycleScope.launch {
try {
val result = AFCore.barcode().submitBarcodeId(
id = scannedValue,
lat = 37.422,
lng = -122.084,
)
if (result.queued) {
showInfo("Check-in saved — will sync when you're back online.")
} else {
showSuccess("Checked in!")
}
} catch (t: Throwable) {
showError("Could not submit barcode: ${t.message}")
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
let result = try await AFCore.shared.barcode().submitBarcodeId(
id: scannedValue,
lat: 37.422,
lng: -122.084
)
if result.queued {
showInfo("Check-in saved — will sync when you're back online.")
} else {
showSuccess("Checked in!")
}
} catch {
showError("Could not submit barcode: \\(error.localizedDescription)")
}
}Content copied to clipboard