Coder Social home page Coder Social logo

ryanfu / jlpermissions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jlaws/jlpermissions

0.0 1.0 0.0 349 KB

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.

License: MIT License

Ruby 3.24% Objective-C 96.76%

jlpermissions's Introduction

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.

jlpermissions's People

Contributors

erneestoc avatar gekitz avatar jcavar avatar jlaws avatar null09264 avatar pmairoldi avatar rynecheow avatar sachinkesiraju avatar sviatoslav avatar vincentsit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.