AREK is a clean and easy to use wrapper over any kind of iOS permission.
- show a native popup used to avoid to burn the possibility to ask to iOS the real permission
- show a popup to invite the user to re-enable the permission if it has been denied
- manage through an easy configuration how many times to ask the user to re-enable the permission (Only once, every hour, once a day, weekly, always😷)
🚨 AREK is a Swift 3 and XCode 8 compatible project🚨
Implemented permissions
- Camera
- Contacts
- Events (Calendar)
- Health
- Location (Always)
- Location (When in use)
- Microphone
- Notifications
- Photo
- Reminders
Check permission status
let permission = ArekPhoto() permission.status { (status) in switch status { case .Authorized: print("Yoah! ✅ ") case. Denied: print (! "" ⛔ ️!" ) case .NotDetermined: print("! 🤔!" )}}Copy the code
let permission = ArekEvent() permission.manage { (status) in switch status { case .Authorized: Symbol = "✅" case. Denied: symbol = "⛔️" case. NotDetermined: symbol = "🤔"}}Copy the code
Permission Configuration
Each permission type included in AREK is configurable through the ArekConfiguration struct. Each permission has a default configuration, so if you are happy with the basic configuration you don’t have to take care about how it works behind the scenes.
An ArekConfiguration is made up by:
frequency: ArekPermissionFrequency (.Always, .EveryHour, .OnceADay, .OnceAWeek, .JustOnce) This frequency value is related to how often you want to the user to re-enable a permission if that one has been disallowed.
Set by default to .OnceADay
presentInitialPopup: Bool This is an initial popup used to ask kindly to the user to allow a permission. This is useful to avoid burning the possibility to show the system popup.
Set by default to true
presentReEnablePopup: Bool This is the popup used to kindly to the user to re-enable that permission. The frequency value is related to this popup.
Set by defaul to true
CocoaPods
You could add to your Podfile the line
use_frameworks! target ‘MyTarget’ do pod ‘arek’, ‘~> 0.0.5’ end
The Add github.com/ennioma/are… folder to your project.
🙏 Take care about adding the ArekHealth class to your project. It includes HealthKit in your project, so if you do this without using HealthKit, your app will be rejected during the AppStore review.
Contribute
Contributions are welcome 🙌 If you’d like to improve this projects I’ve shared with the community, just open an issue or raise a PR.
AREK is available under the MIT license. See the LICENSE file for more info.
TODO:
- split podfile.spec in submodules to let the devs to add only the desired permissions
- add support to carthage
- add tests to every permission type