Latest 2.2.8
Homepage https://github.com/jlaws/JLPermissions
License MIT
Platforms ios 7.0, requires ARC
Dependencies DBPrivacyHelper
Authors

Version
Platform

Requirements

iOS 7.0+

Installation

JLPermissions is available through CocoaPods, to install it simply add any or all of the following lines to your Podfile:

pod "JLPermissions/Calendar"
pod "JLPermissions/Camera"
pod "JLPermissions/Contacts"
pod "JLPermissions/Facebook"
pod "JLPermissions/Health"
pod "JLPermissions/Location"
pod "JLPermissions/Microphone"
pod "JLPermissions/Notification"
pod "JLPermissions/Photos"
pod "JLPermissions/Reminders"
pod "JLPermissions/Twitter" 

Only add the pod for the permissions you plan on using. Apple rejects apps that include Healthkit API’s but do not use them.

Usage

To run the example project; clone the repo, and run pod install, then open JLPermissionsExample.xcworkspace.

The method for asking for each type of permission (other than push notifications) is virtually identical. Here is an example of the API:


typedef NS_ENUM(NSInteger, JLAuthorizationStatus) {
  JLPermissionNotDetermined = 0,
  JLPermissionDenied,
  JLPermissionAuthorized
};

typedef void (^AuthorizationHandler)(bool granted, NSError *error);

- (JLAuthorizationStatus)authorizationStatus;
- (void)authorize:(AuthorizationHandler)completion;
- (void)authorizeWithTitle:(NSString *)messageTitle
                   message:(NSString *)message
               cancelTitle:(NSString *)cancelTitle
                grantTitle:(NSString *)grantTitle
                completion:(AuthorizationHandler)completion;
- (void)displayErrorDialog;

Author

Projects

Here is a list of iPhone apps utilizing this library (let me know if you want your app added):

License

JLPermissions is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JLPermissions",
    "version": "2.2.8",
    "summary": "User permission dialogs.",
    "description": "Ask the user for permissions before iOS does increasing the chance of acceptance on future requests.",
    "homepage": "https://github.com/jlaws/JLPermissions",
    "license": "MIT",
    "authors": {
        "Joe Laws": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jlaws/JLPermissions.git",
        "tag": "2.2.8"
    },
    "dependencies": {
        "DBPrivacyHelper": [
            "0.6.3"
        ]
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "subspecs": [
        {
            "name": "Core",
            "source_files": "JLPermissions/JLPermissionsCore*"
        },
        {
            "name": "Calendar",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLCalendarPermission.?",
            "frameworks": "EventKit"
        },
        {
            "name": "Camera",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLCameraPermission.?",
            "frameworks": "AVFoundation"
        },
        {
            "name": "Contacts",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLContactsPermission.?",
            "frameworks": "AddressBook"
        },
        {
            "name": "Facebook",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLFacebookPermission.?",
            "frameworks": "Accounts"
        },
        {
            "name": "Health",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLHealthPermission.?",
            "frameworks": "HealthKit"
        },
        {
            "name": "Location",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLLocationPermission.?",
            "frameworks": "CoreLocation"
        },
        {
            "name": "Microphone",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLMicrophonePermission.?",
            "frameworks": "AVFoundation"
        },
        {
            "name": "Notification",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLNotificationPermission.?"
        },
        {
            "name": "Photos",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLPhotosPermission.?",
            "frameworks": "AssetsLibrary"
        },
        {
            "name": "Reminders",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLRemindersPermission.?",
            "frameworks": "EventKit"
        },
        {
            "name": "Twitter",
            "dependencies": {
                "JLPermissions/Core": []
            },
            "source_files": "JLPermissions/JLTwitterPermission.?",
            "frameworks": "Accounts"
        }
    ]
}

Pin It on Pinterest

Share This