getMultiplePermissionState

abstract fun getMultiplePermissionState(vararg permissions: String): StateFlow<MultiplePermissionState>

Returns StateFlow of a combining state for permissions

Parameters

permissions

List of permissions (for e.g. android.Manifest.permission.READ_CONTACTS, android.Manifest.permission.READ_SMS)

Example:

permissionFlow.getMultiplePermissionState(
android.Manifest.permission.READ_CONTACTS,
android.Manifest.permission.READ_SMS
).collect { state ->
// All permission states
val allPermissions = state.permissions

// Check whether all permissions are granted
val allGranted = state.allGranted

// List of granted permissions
val grantedPermissions = state.grantedPermissions

// List of denied permissions
val deniedPermissions = state.deniedPermissions
}