submit

abstract suspend fun submit(payload: Map<String, String>): AFResult

Submits a diagnostic payload.

Return

AFResult indicating success or failure.

Parameters

payload

A Map of key-value pairs to submit. For example, {"wifi": "true", "bluetooth": "true"}.

Throws

if the request fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val payload = mapOf("wifi" to "true", "bluetooth" to "true")
val result = AFCore.diagnostics().submit(payload)
if (result.status) {
showMessage("Diagnostics submitted successfully")
} else {
showError("Diagnostics submission failed")
}
} catch (t: Throwable) {
showError("Failed to submit diagnostics: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let payload = ["wifi": "true", "bluetooth": "true"]
let result = try await AFCore.shared.diagnostics().submit(payload: payload)
if result.status {
self.showMessage("Diagnostics submitted successfully")
} else {
self.showError("Diagnostics submission failed")
}
} catch {
self.showError("Failed to submit diagnostics: \(error.localizedDescription)")
}
}