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>: Contains exists (whether a device-user record exists) and deviceUserId (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 setupMobileSync calls.
  • Ensure connectionId is non-blank before calling — a blank value returns an error result.

Did this page help you?