Get Device User Status
b.well Health SDK for Android
Retrieving Device User Status
Overview
The getDeviceUserStatus method in the b.well SDK checks whether a device-user record already exists for a given connection, and returns its identifier if so. This is useful for determining whether mobile sync has already been provisioned for a connection before calling setupMobileSync again.
Method Signature
suspend fun getDeviceUserStatus(connectionId: String): BWellResult<DeviceUserStatus>connectionId: The identifier of the connection to check.BWellResult<DeviceUserStatus>: Containsexists(whether a device-user record exists) anddeviceUserId(its identifier, if any).
Example Usage
val result = BWellSdk.device.getDeviceUserStatus(connectionId)
if (result.success() && result is BWellResult.SingleResource) {
val exists = result.data?.exists
val deviceUserId = result.data?.deviceUserId
}Best Practices
- Check this status before re-provisioning a connection to avoid unnecessary
setupMobileSynccalls. - Ensure
connectionIdis non-blank before calling — a blank value returns an error result.
Updated 13 days ago
Did this page help you?
