Android Permissions

Permissions#

You can check here about what are the permissions needed for calls in Android and iOS.

Android Permissions#

Open the file android/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" />

For video call, we need below permissions:

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

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" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Ensure that your app has the android.permission.MODIFY_AUDIO_SETTINGS permission to enable seamless audio routing between the device receiver, headset, and Bluetooth devices.

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

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

iOS Permissions#

Open the file ios/Runner/Info.plist and add the following Key and it's corresponding Descriptions

NSCameraUsageDescription
NSMicrophoneUsageDescription

Note : If you are using the Permission Handler in Flutter, make sure to add the corresponding GCC_PREPROCESSOR_DEFINITIONS in Podfile.

GCC_PREPROCESSOR_DEFINITIONS#

Inside the ios/Podfile file, use the following code. You can also add other required permission for your application.

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',
]
end
end
end