1. Determine whether the user has the permission to access the album.
# Import ALAuthorizationStatus author = [ALAssetsLibraryauthorizationStatus]; if (author = privileged | author = kclthorizationstatusdenied) {// No permission} typedef enum {authorization = 0, // The user has not yet made a greeting for choosing this app kclthorizationstatusrestricted, // This app is not authorized to access photo data. It may be that the parent has the permission to kCLAuthorizationStatusDenied. // The user has explicitly denied that the photo data application has accessed kCLAuthorizationStatusAuthorized. // The user has authorized the application to access the photo data} CLAuthorizationStatus;
2. Determine whether the user has the permission to access the camera
You can access the camera before iOS7, And you can access the camera after iOS7.
# Import AVAuthorizationStatus authStatus = [authorization: AVMediaTypeVideo]; if (authStatus = AVAuthorizationStatusRestricted | authStatus = AVAuthorizationStatusDenied) {// No permission}
3. Determine whether to enable the positioning service
[CLLocationManagerlocationServicesEnabled] // checks whether the positioning service of the entire iOS system is enabled to detect whether the positioning service of the current application is enabled. You need to use the following method to detect-(void) locationManager :( CLLocationManager *) manager didFailWithError :( NSError *) error