getDeviceInfo

Returns metadata for all currently paired PingOne MFA accounts.

PingOne MFA supports multiple service regions. The native SDK queries all regions and aggregates the results. If some regions succeed and others fail, the SDK may return both account data and error context in the same callback.

On Result.success, the value is a Pair where:

  • first — the aggregated list of PingOneMfaAccount objects across all regions.

  • second — an optional List<Error> with per-region diagnostic errors from the SDK. Non-null only when the SDK returned partial error context alongside valid data. Developer use only — log these for debugging but do not surface them to users; the account list is still valid when this list is present.

On Result.failure, all regions failed or no data was returned. The PingOneMFAException contains per-region failure details in PingOneMFAException.internalErrorsList.

PingOneMFA.getDeviceInfo()
.onSuccess { (accounts, diagnosticErrors) ->
showAccounts(accounts)
diagnosticErrors?.forEach { err ->
Log.w("MFA", "Region diagnostic: code=${err.code} info=${err.userInfo}")
}
}
.onFailure { e ->
Log.e("MFA", "Failed to load accounts: ${e.message}")
(e as? PingOneMFAException)?.internalErrorsList?.forEach { err ->
Log.e("MFA", "Region failure: code=${err.code} info=${err.userInfo}")
}
}