sparrowcode/PermissionsKit

Universal API for request permission and get its statuses.

Swift

5,807

1,246 commits

updated Sep 12, 2026

See the code

README

PermissionsKit

Universal API for requesting permissions and reading their status — .authorized, .denied & .notDetermined. Each permission ships as a separate product, so the app compiles only the ones it actually uses.

Installation

In Xcode: File → Add Package Dependencies → paste URL:

https://github.com/sparrowcode/PermissionsKit

Then pick the products you need. Add only those — every permission API you link is visible to App Review, and unused ones invite questions about why the app needs them.

Permissions

PermissionProductKey for Info.plist
BluetoothBluetoothPermissionNSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription
CalendarCalendarPermissionNSCalendarsUsageDescription, NSCalendarsFullAccessUsageDescription, NSCalendarsWriteOnlyAccessUsageDescription
CameraCameraPermissionNSCameraUsageDescription
ContactsContactsPermissionNSContactsUsageDescription
FaceIDFaceIDPermissionNSFaceIDUsageDescription
HealthHealthPermissionNSHealthUpdateUsageDescription, NSHealthShareUsageDescription
LocationLocationPermissionNSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription
Media LibraryMediaLibraryPermissionNSAppleMusicUsageDescription
MicrophoneMicrophonePermissionNSMicrophoneUsageDescription
MotionMotionPermissionNSMotionUsageDescription
NotificationNotificationPermission—
Photo LibraryPhotoLibraryPermissionNSPhotoLibraryUsageDescription, NSPhotoLibraryAddUsageDescription
RemindersRemindersPermissionNSRemindersUsageDescription, NSRemindersFullAccessUsageDescription
SiriSiriPermissionNSSiriUsageDescription
Speech RecognizerSpeechRecognizerPermissionNSSpeechRecognitionUsageDescription
TrackingTrackingPermissionNSUserTrackingUsageDescription

Usage

Request a permission:

import PermissionsKit
import NotificationPermission

Permission.notification([.alert, .badge, .sound]).request {
    // Called once the user answers the system dialog.
}

Read its status:

import PermissionsKit
import CameraPermission

let authorized = Permission.camera.authorized

[!WARNING] FaceID can't tell .authorized from .notDetermined — both come back as .notDetermined. Only .denied is reliable.

Keys in Info.plist

Apple requires a usage description for most permissions. Get the key for a permission:

let key = Permission.bluetooth.usageDescriptionKey

[!NOTE] Use the key itself, not the description text — Xcode won't build otherwise.

Localisation

An xliff export creates the keys for you. Doing it by hand means adding an InfoPlist.strings file, selecting the languages in the inspector, and writing the keys there:

"NSCameraUsageDescription" = "Here description of usage camera";
calendar
camera
dialog
interface
ios
location
notification
permission
permissionkit
permissions
photo-gallery
reminder
request
scope
sparrow
sppermissions
ui
wizard
xcode

sparrowcode/PermissionsKit

Universal API for request permission and get its statuses.

Swift

5,807

1,246 commits

updated Sep 12, 2026

See the code

README

PermissionsKit

Universal API for requesting permissions and reading their status — .authorized, .denied & .notDetermined. Each permission ships as a separate product, so the app compiles only the ones it actually uses.

Installation

In Xcode: File → Add Package Dependencies → paste URL:

https://github.com/sparrowcode/PermissionsKit

Then pick the products you need. Add only those — every permission API you link is visible to App Review, and unused ones invite questions about why the app needs them.

Permissions

PermissionProductKey for Info.plist
BluetoothBluetoothPermissionNSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription
CalendarCalendarPermissionNSCalendarsUsageDescription, NSCalendarsFullAccessUsageDescription, NSCalendarsWriteOnlyAccessUsageDescription
CameraCameraPermissionNSCameraUsageDescription
ContactsContactsPermissionNSContactsUsageDescription
FaceIDFaceIDPermissionNSFaceIDUsageDescription
HealthHealthPermissionNSHealthUpdateUsageDescription, NSHealthShareUsageDescription
LocationLocationPermissionNSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription
Media LibraryMediaLibraryPermissionNSAppleMusicUsageDescription
MicrophoneMicrophonePermissionNSMicrophoneUsageDescription
MotionMotionPermissionNSMotionUsageDescription
NotificationNotificationPermission—
Photo LibraryPhotoLibraryPermissionNSPhotoLibraryUsageDescription, NSPhotoLibraryAddUsageDescription
RemindersRemindersPermissionNSRemindersUsageDescription, NSRemindersFullAccessUsageDescription
SiriSiriPermissionNSSiriUsageDescription
Speech RecognizerSpeechRecognizerPermissionNSSpeechRecognitionUsageDescription
TrackingTrackingPermissionNSUserTrackingUsageDescription

Usage

Request a permission:

import PermissionsKit
import NotificationPermission

Permission.notification([.alert, .badge, .sound]).request {
    // Called once the user answers the system dialog.
}

Read its status:

import PermissionsKit
import CameraPermission

let authorized = Permission.camera.authorized

[!WARNING] FaceID can't tell .authorized from .notDetermined — both come back as .notDetermined. Only .denied is reliable.

Keys in Info.plist

Apple requires a usage description for most permissions. Get the key for a permission:

let key = Permission.bluetooth.usageDescriptionKey

[!NOTE] Use the key itself, not the description text — Xcode won't build otherwise.

Localisation

An xliff export creates the keys for you. Doing it by hand means adding an InfoPlist.strings file, selecting the languages in the inspector, and writing the keys there:

"NSCameraUsageDescription" = "Here description of usage camera";
calendar
camera
dialog
interface
ios
location
notification
permission
permissionkit
permissions
photo-gallery
reminder
request
scope
sparrow
sppermissions
ui
wizard
xcode

Significant stargazers

Yuki Nishijima

556 followers · starred Mar 2020

Ahnaf Mahmud

117 followers · starred Jul 2024

Siong

218 followers · starred Mar 2017

Luca Ban

228 followers · starred Apr 2024