Apple’s operating system requires applications to request authorization before accessing sensitive information or device features. If your application requires access to features such as the device’s camera, microphone, or location, the device user must grant access to your application.
For more information on requesting authorizations on iOS devices, refer to the Apple documentation.
To access the device features that your application requires, you must:
A feature usage description or purpose string is a message that the iOS system displays when your application tries to access the device feature. It’s best practice to add a clear description stating the reason for application access.
You can enter the feature usage description in Configuration section of Player settingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary (menu: Edit > Project Settings > Player > Other Settings). When you add the usage description to Player settings, Unity also adds it as a key-value pair to the info.plist file. For example, if your application wants to access the device camera, add Camera usage description in the Player settings. The description you enter automatically appears as NSCameraUsageDescription key value in the info.plist file. For more information, refer to Apple-specific iOS Player Settings.
Alternatively, you can directly add the required feature usage description key-value pairs in the info.plist file.
After you add the feature usage description, send a request for camera or microphone access using Application.RequestUserAuthorization method. The system displays a dialog describing the request for authorization.
For a code example that shows how to use this API, refer to Application.RequestUserAuthorization.
For information about accessing device location, refer to LocationService API.
You can check the authorization status of your request using Application.HasUserAuthorization method.
Note: The device user can modify the feature authorization through device settings at any given time. You can use Application.HasUserAuthorization method to verify the authorization status of a feature before accessing it.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.