android-coroutines / nl.adaptivity.android.coroutines / android.accounts.AccountManager

Extensions for android.accounts.AccountManager

getAuthToken

suspend fun <A : Activity> AccountManager.getAuthToken(activity: A, account: Account, authTokenType: String, options: Bundle? = null): String?

Get an authentication token from the account manager asynchronously. If required it will take care of launching the permissions dialogs as needed.

hasFeatures

suspend fun AccountManager.hasFeatures(account: Account, features: Array<String?>): Boolean