132 Commits
Author SHA1 Message Date
Ivan VorobeiandClaude Opus 5 1ccec73d24 refactor: drop dead branches and unused imports across the permissions
EKAuthorizationStatusAuthorized is declared as an alias of fullAccess and
kCLAuthorizationStatusAuthorized as an alias of authorizedAlways, so in
Calendar, Reminders and Location the branch listed first swallowed the one
below it. Location now says plainly what it always did: always covers either
access level, when-in-use covers only its own.

Calendar and Location kept a Permission.Kind and unpacked it with switches
ending in fatalError, although each type only ever holds its own kind. They
store the access level instead and build the kind from it, which also lets
Calendar request the level directly rather than through two intermediate
closures.

The location handlers no longer implement locationManager(_:didChangeAuthorization:),
deprecated since iOS 14 and never called at the current deployment target.
Location imported EventKit instead of CoreLocation and Bluetooth imported
CloudKit without using it. The German strings file still carried nine keys
from an interface the package no longer ships.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:41:12 +04:00
Ivan VorobeiandClaude Opus 5 0b4ebc447d refactor: move microphone and photo library off deprecated APIs
AVAudioSession.recordPermission and requestRecordPermission are deprecated
since iOS 17 in favour of AVAudioApplication, with the old path kept for
iOS 15 and 16.

PHPhotoLibrary.authorizationStatus() and requestAuthorization(_:) carry
API_DEPRECATED_WITH_REPLACEMENT and, by Apple's own note, report plain
authorized even under limited access; both now go through the access level
variants, available since iOS 14.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:41:03 +04:00
Ivan VorobeiandClaude Opus 5 a3f8c5d7ea fix: correct the Health usage keys, Chinese locale folder and Motion request
NSHealthShareUsageDescription describes reading samples and
NSHealthUpdateUsageDescription describes writing them, so the two keys were
returned by the wrong properties — apps copying them into Info.plist ended up
with swapped descriptions.

Simplified Chinese lived in zh_Hans.lproj with an underscore, which no bundle
ever matches; the folder is now zh-Hans.lproj like its Traditional sibling.

Motion called stopActivityUpdates() after a query, though that method pairs
with startActivityUpdates and did nothing here. The remaining trick — asking
for an empty date range purely to raise the dialog — is now explained.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:41:03 +04:00
Ivan VorobeiandClaude Opus 5 345f4e7ba6 refactor: adopt Swift 6 language mode and remove the CocoaPods plumbing
The manifest moves to swift-tools-version 6.3 with swiftLanguageModes
[.v6], and the per-product PERMISSIONSKIT_* defines are gone — they only
existed to carve the sources into podspec subspecs, while SPM already
compiles every permission as its own target. Products and targets are now
derived from one list of permission names instead of sixteen identical
blocks.

In the sources that means the conditional import of the core module and
the gates that tested nothing but a define both collapse, Text.bundle
always resolves to .module, and the MIT header leaves all 23 files, as in
the other packages.

For strict concurrency the completion closures become @MainActor rather
than @Sendable: a permission dialog is UI work, and @Sendable would reject
the usual `request { [weak self] in ... }` from a view controller. They are
now called through Task { @MainActor in ... }, copied into a local first
where a delegate would otherwise send a non-Sendable handler; openSettingPage
is main actor isolated and drops its queue hop; the handler singletons are
marked nonisolated(unsafe), and the notification settings lookup keeps only
the Sendable authorization status behind its semaphore.

Also fixes the reqeustUpdate and Ovveride typos and renames the notification
options file that carried "userNotifcation" in its name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:25:46 +04:00
Ivan VorobeiandClaude Opus 5 f363137dec refactor(sources): drop code paths for now-unsupported OS versions
The raised deployment targets make every availability check below iOS 15,
tvOS 15 and watchOS 9 always true, so the legacy branches were dead code:

- BluetoothPermission: collapse the 13.1 / 13.0 / CBPeripheralManager
  cascade into CBCentralManager.authorization
- BluetoothHandler: same collapse, and read the authorization from the
  class property instead of the instance one deprecated in iOS 13.1,
  which also removes the separate visionOS branch
- LocationPermission, LocationAccuracy: drop the iOS 14 fallbacks and a
  nested os(iOS) check inside a file already gated on it
- Location handlers: unmark locationManagerDidChangeAuthorization and
  read authorizationStatus off the manager instead of the deprecated
  class method, collapsing the per-platform ifdefs
- NotificationAccess: announcement and timeSensitive no longer fall back
  to alert
- CameraPermission, TrackingPermission: drop the @available on the types

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 14:00:27 +04:00
Zane Shannon 883290447d expose SpeechPermission for macOS 2025-02-26 11:40:16 -08:00
Zane Shannon e449e39121 Add macOS support to MicrophonePermission.swift 2024-12-27 18:10:59 -08:00
Ivan Vorobei 5e5935998c Updated doc for permissions accesses. 2024-11-18 16:07:26 +03:00
Jonas Richard Richter 430dba4781 Merge branch 'sparrowcode:main' into main 2024-11-01 13:43:38 +01:00
David e6a501b070 Adapt ContactsPermission to iOS 18, changing the limited status to return as authorized.
After iOS 18, a new status limited was added to CNAuthorizationStatus - ‘This application is authorized to access some contact data.’ In the limited status, I tried using CNContactStore to fetch contact data, and it successfully retrieved the corresponding data selected by the user. Therefore, I believe this status should be treated as authorized.
2024-09-25 11:00:31 +08:00
Ivan Vorobei f10828f211 Added support visionOS & macOS. 2024-07-10 15:57:46 +03:00
Jonas Richard Richter 8d434eff05 Add notification permission options 2024-06-27 15:24:22 +02:00
Christoph Giesenhagen 6b3863d206 Fix mapping of location authorization status 2023-10-04 12:36:23 +02:00
Ivan Vorobei c476309e43 Merge location permissions to one permission with access. 2023-10-02 22:48:23 +03:00
Ivan Vorobei a54806370a Fixed state request. 2023-10-02 22:06:20 +03:00
ostatnicky 8356098ba3 Fix full access request to Calendar 2023-09-28 10:59:03 +02:00
Ivan Vorobei 6c4136dcb4 Updated asking permission for calendar. 2023-09-27 17:57:23 +03:00
Ivan Vorobei 6d13eb81fa Clean requests permission with sub-access levels. 2023-09-27 17:51:17 +03:00
Ivan Vorobei 539e3cee2f Merge pull request #320 from alexanderpuchta/main
Add writeOnly type for calendar
2023-09-27 17:35:35 +03:00
Alexander Puchta 1d52e607ab Update README.md and added available iOS 17 check for writeOnly permission 2023-09-27 11:50:52 +02:00
Alexander Puchta e2bf80f76c Add writeOnly type for calendar 2023-09-26 22:13:41 +02:00
Ivan Vorobei ddd0759879 Merge pull request #311 from dDomovoj/main
[add] ios 14+ location authorization check delegate
2023-09-26 22:00:39 +03:00
Alexander Puchta 76d1b07e25 camera and reminder usage with iOS 17 2023-09-26 17:55:10 +02:00
parogc 472faf328b Ammend spanish translations
I adapted this translations to use the same strings as the iOS settings app
2023-04-28 13:00:54 +02:00
Peter Viszt 0bd479b350 Fix build warning
Non-'@objc' instance method in extensions cannot be overridden; use 'public' instead
2023-04-17 18:51:15 +02:00
dDomovoj 409deeb9be [add] ios 14+ location authorization check delegate method 2022-11-07 12:53:34 +01:00
Ivan Vorobei b3b87d4e3a Merge pull request #308 from duyhungtnn/patch-1
Allow using the TrackingPermision from iOS 14.0.0
2022-11-07 14:37:47 +03:00
Thomas M c2e200266f Merge branch 'main' into 8.0.2 2022-10-27 16:32:55 +02:00
Thomas M acfed94273 Update Localizable.strings
Fix German texts
2022-10-27 16:29:48 +02:00
duyhungtnn 62c78d72a8 fix : can not use TrackingPermission iOS 14 2022-08-26 20:44:03 +07:00
Thomas May 5de2df5c57 Update German Localization 2022-07-11 15:19:54 +02:00
Thomas May 3cb66415b3 Localization changes for GErman 2022-07-11 15:18:04 +02:00
Moi Gutierrez c0f9f0c672 description update [skip ci] 2022-06-19 17:14:59 -03:00
Moi Gutierrez c8ae8040c4 Update Permission.swift
added Status: CustomStringConvertible for easy, clear logging.
2022-06-17 22:41:46 -03:00
Nikolay 95c64b36f5 Cleaned localisations. 2022-06-15 16:48:26 +03:00
Ivan Vorobei 1547693f49 Added localised titles. 2022-06-13 16:32:40 +03:00
Ivan Vorobei aa76e515a9 Clean code. 2022-06-13 16:19:39 +03:00
Ivan Vorobei 621497dff5 Clean code. 2022-04-19 16:13:27 +03:00
Ivan Vorobei 3cd5300d15 Clean names. 2022-04-17 11:59:14 +03:00
Ivan Vorobei f9daaa0d5f Clean names and models. 2022-04-17 11:11:07 +03:00
Ivan Vorobei 976c867701 Clean naming. 2022-04-16 22:34:48 +03:00
Ivan Vorobei 3ecba3c0d6 Updated email. 2022-02-27 20:38:37 +04:00
Mousa ae758b1ba8 add Persian language 2022-02-03 19:54:59 +01:00
Essam 9f0cf6173a Improve Arabic translation 2022-01-31 05:03:38 +03:00
Ivan Vorobei bae86e3eca Fixed compability. 2022-01-01 20:08:48 +03:00
Ivan Vorobei 9d9673ca5f Removed precise library. Moved precise to location permissions. Updated Readme. 2022-01-01 19:59:20 +03:00
Ivan Vorobei ccb95f49bc Ovveridable open settings page. Updated Readme. 2021-12-14 11:36:29 +03:00
Mohammad Rahchamani 61f50c5201 delete unused OpenService 2021-12-09 05:02:56 +03:30
Mohammad Rahchamani ca73f13a49 call openSettingPage on permission to handle deny action instead of OpenService 2021-12-09 05:01:20 +03:30
Mohammad Rahchamani 583fb24bdb add openSettingPage method to Permission class to handle opening settings page when user denies the request with a default implementation to open the app setting page. 2021-12-09 04:59:33 +03:30