Android Permissions

You can check here about what are the permissions needed for chats and calls. Open the file app/src/main/AndroidManifest.xml, and add the following code in outside the <application> tag.

Add device permissions for access the application#

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Add runtime permissions for calls#

For audio calls, we need below permissions:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

You can use the below method to check audio call permissions:

CallManager.isAudioCallPermissionsGranted();

For video call, we need below permissions:

Manifest.permission.RECORD_AUDIO
Manifest.permission.CAMERA
Manifest.permission.READ_PHONE_STATE

You can use the below method to check video call permissions:

CallManager.isVideoCallPermissionsGranted();

From Android 12, ensure that android.permission.BLUETOOTH_CONNECT and android.permission.READ_PHONE_STATE runtime permissions are granted for your app for seameless audio routing and gsm call handling. If the android.permission.BLUETOOTH_CONNECTpermission is not granted, call audio will not be routed to BT Headset even though it is connected. If the android.permission.READ_PHONE_STATE permission is not granted, gsm call related functionalities will not work in sdk.

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

From Android 13, CallSDK need below permission to show ongoing call notification.

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

You can use the below method to check call notification permission:

CallManager.isNotificationPermissionsGranted();

Add runtime permissions for chat#

To choose contact, we need below permissions:

<uses-permission android:name="android.permission.READ_CONTACTS" />

You can use the below code to check runtime permission for contact:

if (MediaPermissions.isPermissionAllowed(this, Manifest.permission.READ_CONTACTS)) {
// Permission is already granted, you can proceed with reading contacts.
// Put your code here to read contacts.
} else {
// Permission is not granted, request it.
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, REQUEST_CODE);
}

To choose media such as image, video, audio and documents, we need below permissions:

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

From Android 13, To choose media such as image, video, audio and documents, we need below permissions:

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

To choose Location , below permissions should be added.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

From Android 13,To receive notification message, we need below permissions:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />