AccountSetupClientFactory

object AccountSetupClientFactory


Factory to create AccountSetupClient

Summary

Public functions

AccountSetupClient
create(context: Context, registry: ActivityResultRegistry)

Creates AccountSetupClient that can be used to add work accounts to a device.

Public functions

create

fun create(context: Context, registry: ActivityResultRegistry): AccountSetupClient

Creates AccountSetupClient that can be used to add work accounts to a device.

Note: After creating the client, you must register its lifecycleObserver property with the lifecycle of the host activity or fragment before the fragment or activity is created (e.g., in onCreate): lifecycle.addObserver(accountSetupClient.getLifecycleObserver()).

Parameters
context: Context

Application Context of DPC application that wishes to add a work account.

registry: ActivityResultRegistry

ActivityResultRegistry to register activity result callbacks. This must be the registry from the activity that will be in androidx.lifecycle.Lifecycle.State.CREATED state before calling AccountSetupClient.launchAuthenticationActivity.