IOS10 Permissions Breakdown problem and solution _ios

Source: Internet
Author: User

IOS10 Permissions Crash issue

Today, mobile phone upgrade iOS10 Beta, and then with the development of the project installed a IPA package, found that click on access to relevant rights directly crash, and the console output some information:

This is the app has crashed because it attempted to access privacy-sensitive data without a usage. The app ' s info.plist must contain a nscontactsusagedescription key with a string value explaining to the user how the app uses this data.

It means: You need to add a "nscontactsusagedescription" Key,value in the Info.plist file to add a description.

1, find the Info.plist file in the project, right-click an open as, open as source Code
2, respectively copy the following value and Key,key must not be wrong, value seemingly can be casually filled out

Camera Permission Description:

<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>

Communication record:

<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>

Microphone:

<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>

Camera:

<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>

Eg: other permission descriptions, debug console will have output, add on your own OK

3, copy on the Info.plist file, and then save, as shown in the following figure:

The form of Source Code:


The display form of the property List:

After 4,clean, it's OK to run.

Thank you for reading, I hope to help you, thank you for your support for this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.