checkPermissions

fun checkPermissions(context: Context, permission: List<Permission>, rationale: String? = null, options: Permissions.Options? = null, permissionHandler: PermissionHandler)

Requests the runtime permissions a call needs, prompting the user when any are missing and reporting the outcome on permissionHandler. When all of them are already held it reports success without showing anything.

Do this before creating tracks or joining. Nothing else prompts: without the permission the track factories throw 3017 / 3018, and a room leaves that device off.

Permission.audio covers RECORD_AUDIO and MODIFY_AUDIO_SETTINGS, Permission.video covers CAMERA, and Permission.bluetooth covers BLUETOOTH_CONNECT on Android 12 and newer — below that it asks for nothing.

Parameters

context

an Activity context. A non-activity context works only with Permissions.Options.createNewTask set.

permission

the groups to request.

rationale

shown when the OS asks for a rationale; null skips that dialog.

options

titles and button labels for the SDK's own dialogs; null uses the defaults.

permissionHandler

told which permissions were granted, denied or blocked. PermissionHandler.onGranted runs inline on the calling thread when everything was already held; every other outcome arrives on the main thread.