submitBarcodeId

abstract suspend fun submitBarcodeId(id: String, lat: Double?, lng: Double?): AFResult

Submits a barcode ID to the backend.

Return

An AFResult indicating the outcome of the submission.

Parameters

id

The barcode ID to be submitted.

lat

The latitude of the location where the barcode was scanned.

lng

The longitude of the location where the barcode was scanned.

Throws

if an error occurs during the submission process.

Usage Example:

Android (Kotlin)

´´´kotlin import com.advantahealth.api.AFCore import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch

fun submitBarcode() { GlobalScope.launch { try { val result = AFCore.barcode().submitBarcodeId( id = "your_barcode_id", lat = 37.422, lng = -122.084 ) // Handle result } catch (e: Exception) { // Handle error } } } ´´´

iOS (Swift)

´´´swift import AFCore

func submitBarcode() { AFCore.shared.barcode().submitBarcodeId(id: "your_barcode_id", lat: 37.422, lng: -122.084) { result, error in if let result = result { // Handle result } else if let error = error { // Handle error } } } ´´´