REST API

Enabling Device Enrollment Using the
getEnrollDeviceIntent
Method

You can enable device enrollment by using the
getEnrollDeviceIntent
method. Using this method creates and returns an
Intent
object that you can then use to open the enroll
Activity
.
You can either use the
startActivityForResult
method or the
ActivityResultContracts.StartActivityForResult
method with the returned
Intent
object to start the enroll
Activity
.
val enrollDeviceLauncher = rememberLauncherForActivityResult(contract = ActivityResultContracts.StartActivityForResult()) { if (EnrollResultIntent.isEnrollmentSuccessful(it.resultCode, it.data)) { onDeviceEnrolled() } } val mposUi: MposUi = ... val intent = mposUi.tapToPhone.getEnrollDeviceIntent(activity) enrollDeviceLauncher.launch(intent)
After the enroll
Activity
is completed, the result is returned.