JLPermissions

An iOS pre-permissions utility that lets developers ask users on their own dialog for calendar, contacts, location, photos, reminders, twitter, push notifications and more, before making the system-based permission request.

Github星跟踪图

JLPermissions

Version
Platform

Requirements

iOS 8.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;

License

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

主要指标

概览
名称与所有者smartstore/SmartStoreNET
主编程语言C#
编程语言Objective-C (语言数: 10)
平台
许可证GNU General Public License v3.0
所有者活动
创建于2014-08-13 00:49:19
推送于2023-06-27 23:11:09
最后一次提交2021-12-17 14:36:06
发布数28
最新版本名称4.2.0 (发布于 2021-12-21 12:56:09)
第一版名称1.2.0 (发布于 2013-10-09 02:40:31)
用户参与
星数2.6k
关注者数299
派生数1.5k
提交数9.2k
已启用问题?
问题数2061
打开的问题数25
拉请求数11
打开的拉请求数22
关闭的拉请求数68
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?