Skip to content

Device Permissions

Marco Brescianini edited this page Nov 5, 2024 · 10 revisions

Table of contents

Camera and Microphone

Apps that requires access to camera or microphone must be granted access to those devices explicitly by the user before they can access them. Apps using the Kaleyra Video iOS SDK are no exception, however the SDK is going to take care of it for you automatically the first time it needs to access the camera device or the microphone device. Since iOS 10, app developers are required to add a textual usage description that will be added to the system alerts prompted to the user. You must add NSCameraUsageDescription and NSMicrophoneUsageDescription keys with the corresponding strings that will be prompted to the user in your App Info.plist. Beware, starting from iOS 10.0 if you don't provide NSCameraUsageDescription and NSMicrophoneUsageDescription keys in your app's Info.plist file, the system is going to kill your App anytime it tries to access the camera or microphone devices.

This is the only step the SDK requires you to do.

Here's a step by step guide

First open your App .xcodeproj file in the project navigator panel, then select your app target and the Info panel. Your screen should be displaying something like this:

Permissions 1

Then mouse over any property in the Info.plist file, if you look closely, a "plus" and a "minus" icons should have appeared Click on the plus icon and from the drop down it has appeared select "Privacy - Camera Usage Description", then in the value column insert a meaningful message that will be displayed to the end user when the app will ask her/him to grant access to hers/his camera. You should now be seeing something like this:

Permissions 2

Now do the same steps selecting "Privacy - Microphone Usage Description" this time. And you should good to go.

Permissions 3

Photo Library

The Kaleyra Video SDK provides a rich set of collaboration features that enables your users to share files with other peers during a call. In order to access the files a user wants to share, the SDK might need the permission to access the user's photo library. The Kaleyra Video SDK makes use of UIImagePickerController, which requires you to add the NSPhotoLibraryUsageDescription key alongside a localized message into your App Info.plist.

Adding the NSPhotoLibraryUsageDescription to your App Info.plist it's an easy task. You should follow the same steps you did before when adding the NSCameraUsageDescription and NSMicrophoneUsageDescription keys to the Info.plist file.

Here's a step by step guide

First open your App .xcodeproj file in the project navigator panel, then select your app target and the Info panel. Your screen should be displaying something like this:

Permissions Photo Library 1

Then mouse over any property in the Info.plist file, if you look closely, a "plus" and a "minus" icons should have appeared. Click on the "plus" sign, a focused text field should have appeared, now type "Privacy - Photo Library Usage Description" and in the corresponding value column type in the message that will be prompted to the user when the SDK will try to access hers/his photo library.

Permissions Photo Library 2

Clone this wiki locally