Skip to main content

Handling Device Permissions

Before allowing users to interact with their camera and microphone, it's important to check if the necessary permissions are granted on their Android device. Dyte's Android Core SDK provides easy-to-use APIs to check the status of these permissions.

Checking Permissions

Use the following APIs to check if the camera and microphone permissions are granted:

// Check if CAMERA permission is granted
val cameraPermissionGranted = meeting.localUser.isCameraPermissionGranted

// Check if RECORD_AUDIO (microphone) permission is granted
val micPermissionGranted = meeting.localUser.isMicrophonePermissionGranted

Alternatively, you can also use Android's standard way to check if these permissions are granted:

  • android.permission.CAMERA
  • android.permission.RECORD_AUDIO

Refer to the Android official documentation for more information on checking permissions.

You can use the permission status to enable or disable camera and microphone buttons in the pre-call UI, or provide visual feedback to indicate the availability of these media devices.

Automatic Permission Request

When the Dyte SDK is initialised, it automatically checks for the required media permissions. If the permissions are not granted, the SDK requests them on behalf of the developers.