{"id":1797,"url":"https://github.com/ennioma/arek","last_synced_at":"2026-02-22T12:32:52.992Z","repository":{"id":55648653,"uuid":"73098730","full_name":"ennioma/arek","owner":"ennioma","description":"AREK is a clean and easy way to request any kind of iOS permission (with some nifty features 🤖)","archived":false,"fork":false,"pushed_at":"2023-12-04T16:05:55.000Z","size":5245,"stargazers_count":954,"open_issues_count":7,"forks_count":64,"subscribers_count":18,"default_branch":"develop","last_synced_at":"2024-12-06T20:50:31.443Z","etag":null,"topics":["bluetooth","cloudkit","healthkit","permission","popup"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ennioma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-11-07T16:33:37.000Z","updated_at":"2024-10-25T11:18:46.000Z","dependencies_parsed_at":"2024-01-29T18:06:41.927Z","dependency_job_id":null,"html_url":"https://github.com/ennioma/arek","commit_stats":{"total_commits":212,"total_committers":19,"mean_commits":"11.157894736842104","dds":"0.30188679245283023","last_synced_commit":"4c2b7711a7db4426f76f6019503a227aeac00a46"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennioma%2Farek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennioma%2Farek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennioma%2Farek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennioma%2Farek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ennioma","download_url":"https://codeload.github.com/ennioma/arek/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923697,"owners_count":17992567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","cloudkit","healthkit","permission","popup"],"created_at":"2024-01-05T20:15:56.027Z","updated_at":"2025-10-23T12:39:39.637Z","avatar_url":"https://github.com/ennioma.png","language":"Swift","funding_links":[],"categories":["Permissions","Libs","UI [🔝](#readme)"],"sub_categories":["Other Parsing","UI","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/ennioma/arek/blob/master/code/Assets/arek.png\" alt=\"AREK\" width=\"295\" height=\"54\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n![Platform Version](https://cocoapod-badges.herokuapp.com/p/arek/badge.png)\n![Pod Version](https://cocoapod-badges.herokuapp.com/v/arek/0.0.6/badge.png)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n![License](https://cocoapod-badges.herokuapp.com/l/arek/badge.png)\n[![Swift Version](https://img.shields.io/badge/Swift-3.0.x-orange.svg)]()\n\nAREK is a clean and easy to use wrapper over any kind of iOS permission written in Swift.\n\nWhy AREK could help you building a better app is well described by Apple \u003ca href=\"https://developer.apple.com/ios/human-interface-guidelines/interaction/requesting-permission/\"\u003ehere\u003c/a\u003e:\n\n```\nRequest personal data only when your app clearly needs it.\n...\nExplain why your app needs the information if it’s not obvious.\n...\nRequest permission at launch only when necessary for your app to function.\n...\n```\n\nEvery goal could be easily reached using **AREK**.\n\n* show a native popup used to avoid burning the possibility to ask to iOS the *real* permission\n* show a popup to invite the user to re-enable the permission if it has been denied\n* 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😷)\n\n🚨 AREK is a **Swift 4.2** and **Xcode 10** compatible project 🚨\n\nImportant!\n- If you want to use it with **Xcode 10**, swift 4.2, point to the version [4.0.1](https://github.com/ennioma/arek/releases/tag/4.0.1)\n- If you want to use it with **Xcode 9**, point to any prior version\n\n\n## Build Status\n\n| Branch | Status |\n| ------------- | ------------- |\n| Master | [![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=59a16154a7ae7b000183f1cf\u0026branch=master\u0026build=latest)](https://dashboard.buddybuild.com/apps/59a16154a7ae7b000183f1cf/build/latest?branch=master) |\n| Develop | [![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=59a16154a7ae7b000183f1cf\u0026branch=master\u0026build=latest)](https://dashboard.buddybuild.com/apps/59a16154a7ae7b000183f1cf/build/latest?branch=develop) |\n\n# Table of Contents\n1. [Implemented permissions](#implementedPermissions)\n2. [How to use AREK](#howTo)\n3. [Permissions Configuration](#permissionsConfiguration)\n4. [How to install AREK](#howToInstall)\n5. [How to contribute](#contribute)\n6. [TODO](#todo)\n7. [License and Credits](#licenseCredits)\n\n\u003ca name=\"implementedPermissions\"\u003e\u003c/a\u003e\n# Implemented permissions\n- [x] Camera\n- [x] Bluetooth\n- [x] CloudKit\n- [x] Contacts\n- [x] Events (Calendar)\n- [x] Health\n- [x] Location (Always)\n- [x] Location (When in use)\n- [x] Media Library\n- [x] Microphone\n- [x] Motion\n- [x] Notifications\n- [x] Photo\n- [x] Reminders\n- [x] Siri\n- [x] Speech Recognizer\n\n\u003ca name=\"howTo\"\u003e\u003c/a\u003e\n# How to use AREK\n## Check permission status\n```swift\n    let permission = ArekPhoto()\n\n    permission.status { (status) in\n        switch status {\n        case .authorized:\n            print(\"! ✅ !\")\n        case .denied:\n            print(\"! ⛔️ !\" )\n        case .notDetermined:\n            print(\"! 🤔 !\" )\n        case .notAvailable:\n            print(\"! 🚫 !\" )\n        }\n    }\n```\n## Request a permission\n```swift\n    let permission = ArekEvent()\n\n    permission.manage { (status) in\n        switch status {\n        case .authorized:\n            symbol = \"✅\"\n        case .denied:\n            symbol = \"⛔️\"\n        case .notDetermined:\n            symbol = \"🤔\"\n        case .notAvailable:\n            return \"🚫\"\n        }\n    }\n```\n\n\u003ca name=\"permissionsConfiguration\"\u003e\u003c/a\u003e\n# Permissions Configuration\n## General configuration\nEach 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 care about how it works behind the scenes.\n\nAn `ArekConfiguration` is made up by:\n\n\u003e **frequency**: ArekPermissionFrequency (.Always, .EveryHour, .OnceADay, .OnceAWeek, .JustOnce)\nThis frequency value is related to how often you want to the user to re-enable a permission if that one has been disallowed.\n\n\u003e Set by default to **.OnceADay**\n\n----------\n\n\u003e **presentInitialPopup**: Bool\nThis 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.\n\n\u003eSet by default to **true**\n\n----------\n\n\u003e **presentReEnablePopup**: Bool\nThis is the popup used to **kindly** to the user to re-enable that permission. The *frequency* value is related to this popup.\n\n\u003e Set by defaul to **true**\n\n## Configure the initial and the re-enable popup: `ArekPopupData`\n`ArekPopupData` is the struct used to configure both the pre-permission popup and the re-enable popup. These popups could be instances of the amazing [PMAlertController](https://github.com/Codeido/PMAlertController) by [Codeido](http://www.codeido.com/) or native iOS alerts.\n\nThe configuration is the following:\n```ruby\npublic struct ArekPopupData {\n    var title: String!\n    var message: String!\n    var image: String!\n    var type: ArekPopupType!\n\n    public init(title: String = \"\", message: String = \"\", image: String = \"\", type: ArekPopupType = .codeido) {\n        self.title = title\n        self.message = message\n        self.image = image\n        self.type = type\n    }\n}\n```\n\nThis is an example of the `ArekContacts` pre-enable popup using `PMAlertController`:\n\u003cbr /\u003e\n\u003cimg src=\"https://github.com/ennioma/arek/blob/master/code/Assets/arek_contacts.png\" width=\"150\"\u003e\n\nIf you want to present a native `UIAlertController` set the type to `.native` otherwise if you want to setup a `PMAlertController` set the type to `.codeido`.\n\n## Localized Strings\n**AREK** by convention expects to find localized strings in your Localizable files in order to configure the UI.\n\nIn the following table there are the configurations for:\n- Pre-permission popup title\n- Pre-permission popup message\n- Re-enable popup title\n- Re-enable popup message\n- Popup image for that permission\n- Allow button title\n- Deny button title\n\nMessages related to the iOS native permission popup should be configured following the conventions described \u003ca href=\"https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW1\"\u003ehere\u003c/a\u003e.\n\n| Permission      | Pre-permission Title   | Pre-permission Message | Re-Enable Title | Re-Enable Message | Image | Allow Button Title | Deny Button Title |\n| :-------------: | :-------------: | :-------------: | :-------------: | :---------------: | :---: | :----------------: | :---------------: |\n| Camera      | ArekCamera_initial_title | ArekCamera_initial_message | ArekCamera_reenable_title | ArekCamera_reenable_message | ArekCamera_image | ArekCamera_allow_button_title | ArekCamera_deny_button_title |\n| CloudKit      | ArekCloudKit_initial_title | ArekCloudKit_initial_message | ArekCloudKit_reenable_title | ArekCloudKit_reenable_message | ArekCloudKit_image | ArekCloudKit_allow_button_title | ArekCloudKit_deny_button_title\n| Contacts      | ArekContacts_initial_title | ArekContacts_initial_message | ArekContacts_reenable_title | ArekContacts_reenable_message | ArekContacts_image | ArekContacts_allow_button_title | ArekContacts_deny_button_title\n| Events      | ArekEvents_initial_title | ArekEvents_initial_message | ArekEvents_reenable_title | ArekEvents_reenable_message | ArekEvents_image | ArekEvents_allow_button_title | ArekEvents_deny_button_title |\n| HealthKit      | ArekHealth_initial_title | ArekHealth_initial_message | ArekHealth_reenable_title | ArekHealth_reenable_message | ArekHealth_image | ArekHealth_allow_button_title | ArekHealth_deny_button_title |\n| Media Library  | ArekMediaLibrary_initial_title | ArekMediaLibrary_initial_message | ArekMediaLibrary_reenable_title | ArekMediaLibrary_reenable_message | ArekMediaLibrary_image | ArekMediaLibrary_allow_button_title | ArekMediaLibrary_deny_button_title |\n| Microphone  | ArekMicrophone_initial_title | ArekMicrophone_initial_message | ArekMicrophone_reenable_title | ArekMicrophone_reenable_message | ArekMicrophone_image | ArekMicrophone_allow_button_title | ArekMicrophone_deny_button_title |\n| Motion  | ArekMotion_initial_title | ArekMotion_initial_message | ArekMotion_reenable_title | ArekMotion_reenable_message | ArekMotion_image | ArekMotion_allow_button_title | ArekMotion_deny_button_title |\n| Notifications  | ArekNotifications_initial_title | ArekNotifications_initial_message | ArekNotifications_reenable_title | ArekNotifications_reenable_message | ArekNotifications_image | ArekNotifications_allow_button_title | ArekNotifications_deny_button_title |\n| Photo Library  | ArekPhoto_initial_title | ArekPhoto_initial_message | ArekPhoto_reenable_title | ArekPhoto_reenable_message | ArekPhoto_image | ArekPhoto_allow_button_title | ArekPhoto_deny_button_title |\n| Reminders  | ArekReminders_initial_title | ArekReminders_initial_message | ArekReminders_reenable_title | ArekReminders_reenable_message | ArekReminders_image | ArekReminders_allow_button_title | ArekReminders_ deny_button_title|\n| Siri  | ArekSiri_initial_title | ArekSiri_initial_message | ArekSiri_reenable_title | ArekSiri_reenable_message | ArekSiri_image | ArekSiri_allow_button_title | ArekSiri_deny_button_title |\n| Speech Recognizer  | ArekSpeechRecognizer_initial_title | ArekSpeechRecognizer_initial_message | ArekSpeechRecognizer_reenable_title | ArekSpeechRecognizer_reenable_message | ArekSpeechRecognizer_image | ArekSpeechRecognizer_allow_button_title | ArekSpeechRecognizer_deny_button_title |\n| Bluetooth  | ArekBluetooth_initial_title | ArekBluetooth_initial_message | ArekBluetooth_reenable_title | ArekBluetooth_reenable_message | ArekBluetooth_image | ArekBluetooth_allow_button_title | ArekBluetooth_deny_button_title |\n| Location  | ArekBaseLocation_initial_title | ArekBaseLocation_initial_message | ArekBaseLocation_reenable_title | ArekBaseLocation_reenable_message | ArekBaseLocation_image | ArekBaseLocation_allow_button_title | ArekBaseLocation_deny_button_title |\n\n\u003ca name=\"howToInstall\"\u003e\u003c/a\u003e\n# How to install AREK\n## CocoaPods\nAdd AREK to your Podfile\n\n```ruby\nuse_frameworks!\ntarget 'MyTarget' do\n    pod 'arek', '~\u003e 2.0.2'\nend\n```\n\nIf you want to install just a specific permission, let's say `Bluetooth`, you have to specify:\n```ruby\nuse_frameworks!\ntarget 'MyTarget' do\n    pod 'arek/Bluetooth', '~\u003e 2.0.2'\nend\n```\n\n```bash\n$ pod install\n```\n\n## Carthage\n```ruby\ngithub \"ennioma/arek\" ~\u003e 4.0.2\n```\n\nThen on your application target *Build Phases* settings tab, add a \"New Run Script Phase\". Create a Run Script with the following content:\n\n```ruby\n/usr/local/bin/carthage copy-frameworks\n```\n\nand add the following paths under \"Input Files\":\n\n```ruby\n$(SRCROOT)/Carthage/Build/iOS/arek.framework\n$(SRCROOT)/Carthage/Build/iOS/PMAlertController.framework\n```\n\n## Swift Package Manager\n```ruby\nimport PackageDescription\n\nlet package = Package(\n  name: \"YourApp\",\n  dependencies: [\n    .Package(url: \"https://github.com/ennioma/arek.git\", versionMajor: 2, minor: 0)\n  ]\n)\n```\n\n- Note that if you want to install a *Swift 3* version of Arek, the latest compatible version is the *1.7.0*.\n- If you need to build it on Xcode 10, you have to point to the version `3.0.0`.\n\n## Add AREK source code to your project\nAdd [https://github.com/ennioma/arek/tree/master/arek/arek/Arek](https://github.com/ennioma/arek/tree/master/arek/Classes) folder to your project.\n\n🙏 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.\n\n\u003ca name=\"contribute\"\u003e\u003c/a\u003e\n# How to contribute\nContributions are welcome 🙌  If you'd like to improve this projects I've shared with the community, just open an issue or raise a PR from the current develop branch.\n\nFor any information or request feel free to contact me on twitter (@ennioma).\n\n\u003ca name=\"todo\"\u003e\u003c/a\u003e\n# TODO\n- [] Provide a way to inject a custom PMAlertController in a permission\n- [] Provide a way to inject the popup type when the `init()` is called on a permission\n- [] Update the Swift Package Manager installation\n\n\u003ca name=\"licenseCredits\"\u003e\u003c/a\u003e\n# License and Credits\n## License:\nAREK is available under the MIT license. See the LICENSE file for more info.\n\n## Arek on the Web:\n1. [This week in Swift - Natasha The Robot](https://swiftnews.curated.co/issues/113#libraries)\n2. [iOS Dev Weekly - Dave Verwer](https://iosdevweekly.com/issues/281#code)\n\n## Credits:\nIcones provided by `Freepik` and `Vectors Market` from `Flaticon`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fennioma%2Farek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fennioma%2Farek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fennioma%2Farek/lists"}