getInfoSuspend

public final Pair<JsonObject, Array<PingOneSDKError>> getInfoSuspend(Context context)

Get info.

Returns all the users that are paired to the device, per geographical server name. For each region the response includes a list of paired users (each with user id, first name, last name, and device id), a shouldRollback flag, and optional {@link com.pingidentity.pingidsdkv2.communication.models.DeviceRequirementsEvaluation} details at the region level when available.

Sample usage:

lifecycleScope.launch {
    val (deviceInfo, errors) = PingOne.getInfo(context)
    if (errors.isEmpty()) {
        // Parse an array of the users paired to this device
        deviceInfo?.let { publicJson ->
            // Process device info
        }
    } else {
        // Handle errors
        errors.forEach { error ->
            Log.e("PingOne", "Error: ${error.message}")
        }
        // Note: deviceInfo might still contain partial data even with errors
    }
}

An example of JsonObject returned:

{
"NA": {
    "deviceRequirementsEvaluation": {
      "status": "PASSED",
      "deviceRequirementsDataHash": ""
    },
    "users": [
      {
        "id": "",
        "name": {
          "given": "",
          "family": ""
        },
        "environment": {
          "id": ""
        },
        "device": {
          "id": ""
        }
      }
    ]
},
"EU": {
    "deviceRequirementsEvaluation": {
      "status": "PASSED",
      "deviceRequirementsDataHash": ""
    },
    "users": [
      {
        "id": "",
        "name": {
          "given": "",
          "family": ""
        },
        "environment": {
          "id": ""
        },
        "device": {
          "id": ""
        }
      }
    ]
}
}
    

Return

Pair of nullable JsonObject containing array with all the paired users info and an array of PingOneSDKError (empty if no errors occurred)

Parameters

context

The context of the calling application.