- <!--Albums--
- <key>NSPhotoLibraryUsageDescription</key>
- <string>app need your consent in order to access the album </string>
- <!--camera--
- <key>NSCameraUsageDescription</key>
- <string>app requires your consent to access the camera </string>
- <!--Microphones--
- <key>NSMicrophoneUsageDescription</key>
- <string>app need your consent to access the microphone </string>
- <!--location--
- <key>NSLocationUsageDescription</key>
- <string>app need your consent to access the location </string>
- <!--access to location during use--
- <key>NSLocationWhenInUseUsageDescription</key>
- <string>app requires your consent in order to access the location during use </string>
- <!--always access location-
- <key>NSLocationAlwaysUsageDescription</key>
- <string>app requires your consent in order to always access the location </string>
- <!--calendar--
- <key>NSCalendarsUsageDescription</key>
- <string>app need your consent in order to access the calendar </string>
- <!--reminders--
- <key>NSRemindersUsageDescription</key>
- <string>app need your consent in order to access reminders </string>
- <!--sports and fitness--
- <key>NSMotionUsageDescription</key> <string>app need your consent to access sports and fitness </string>
- <!--Health Updates-
- <key>NSHealthUpdateUsageDescription</key>
- <string>app need your consent to access health updates </string>
- <!--health Sharing--
- <key>NSHealthShareUsageDescription</key>
- <string>app need your consent in order to access health sharing </string>
- <!--Bluetooth--
- <key>NSBluetoothPeripheralUsageDescription</key>
- <string>app need your consent to access Bluetooth </string>
- <!--Media Archive--
- <key>NSAppleMusicUsageDescription</key> <string>app requires your consent in order to access the media database </string>
Info.plist the string string that directly duplicates value by adding key one by one is the prompt text can be filled according to your own needs
#import <AVFoundation/AVCaptureDevice.h>
#import <AVFoundation/AVMediaFormat.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <CoreLocation/CoreLocation.h>
Camera Permissions
Avauthorizationstatus authstatus = [Avcapturedeviceauthorizationstatusformediatype:avmediatypevideo];
if (Authstatus ==avauthorizationstatusrestricted | | This application does not have permission to access the photo data. may be Parental control permissions
Authstatus ==avauthorizationstatusdenied)//user has explicitly denied application access to this photo data
{
No permission to boot to open
Nsurl *url = [nsurlurlwithstring:uiapplicationopensettingsurlstring];
if ([[Uiapplicationsharedapplication]canopenurl:url]) {
[[Uiapplicationsharedapplication]openurl:url];
}
}
Album Permissions
Alauthorizationstatus author = [Alassetslibraryauthorizationstatus];
if (Author ==kclauthorizationstatusrestricted | | author ==kclauthorizationstatusdenied) {
No permission to boot to open
Nsurl *url = [Nsurl urlwithstring:uiapplicationopensettingsurlstring];
if ([[[UIApplication sharedapplication] Canopenurl:url]) {
[[UIApplication sharedapplication] openurl:url];
}
}
IOS10 use, detect, and direct the user to open the camera album and other permissions