diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 0350fe30..9f2e97fd 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -3,5 +3,5 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
-assignees: ivanvorobei, svyatoynick
+assignees: ivanvorobei
---
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 3a1bfa7f..6efc6264 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -3,5 +3,5 @@ name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
-assignees: ivanvorobei, svyatoynick
+assignees: ivanvorobei
---
diff --git a/LICENSE b/LICENSE
index a0468ede..a127164c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 Sparrow Code
+Copyright (c) 2023 Sparrow Code
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Package.swift b/Package.swift
index b9f2f9bb..a632f8b6 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.3
+// swift-tools-version: 5.9
import PackageDescription
@@ -6,9 +6,10 @@ let package = Package(
name: "PermissionsKit",
defaultLocalization: "en",
platforms: [
- .iOS(.v11),
- .tvOS(.v11),
- .watchOS(.v3)
+ .iOS(.v12),
+ .tvOS(.v12),
+ .watchOS(.v4),
+ .macOS(.v13)
],
products: [
.library(
@@ -44,12 +45,8 @@ let package = Package(
targets: ["SpeechRecognizerPermission"]
),
.library(
- name: "LocationWhenInUsePermission",
- targets: ["LocationWhenInUsePermission"]
- ),
- .library(
- name: "LocationAlwaysPermission",
- targets: ["LocationAlwaysPermission"]
+ name: "LocationPermission",
+ targets: ["LocationPermission"]
),
.library(
name: "MotionPermission",
@@ -91,12 +88,6 @@ let package = Package(
.define("PERMISSIONSKIT_SPM")
]
),
- .target(
- name: "LocationExtension",
- swiftSettings: [
- .define("PERMISSIONSKIT_SPM")
- ]
- ),
.target(
name: "CameraPermission",
dependencies: [.target(name: "PermissionsKit")],
@@ -162,24 +153,12 @@ let package = Package(
]
),
.target(
- name: "LocationWhenInUsePermission",
- dependencies: [
- .target(name: "PermissionsKit"),
- .target(name: "LocationExtension")
- ],
- swiftSettings: [
- .define("PERMISSIONSKIT_LOCATION_WHENINUSE"),
- .define("PERMISSIONSKIT_SPM")
- ]
- ),
- .target(
- name: "LocationAlwaysPermission",
+ name: "LocationPermission",
dependencies: [
- .target(name: "PermissionsKit"),
- .target(name: "LocationExtension")
+ .target(name: "PermissionsKit")
],
swiftSettings: [
- .define("PERMISSIONSKIT_LOCATION_ALWAYS"),
+ .define("PERMISSIONSKIT_LOCATION"),
.define("PERMISSIONSKIT_SPM")
]
),
diff --git a/PermissionsKit.podspec b/PermissionsKit.podspec
index e2df6254..e9a49bbc 100644
--- a/PermissionsKit.podspec
+++ b/PermissionsKit.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "PermissionsKit"
- s.version = "9.0.0"
+ s.version = "11.0.0"
s.summary = "Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI."
s.homepage = "https://github.com/sparrowcode/PermissionsKit"
s.source = { :git => "https://github.com/sparrowcode/PermissionsKit.git", :tag => s.version }
@@ -92,26 +92,12 @@ Pod::Spec.new do |s|
"SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_SPEECH PERMISSIONSKIT_COCOAPODS"
}
end
-
- s.subspec 'LocationExtension' do |subspec|
- subspec.source_files = "Sources/LocationExtension/**/*.swift"
- end
- s.subspec 'LocationWhenInUsePermission' do |subspec|
- subspec.dependency 'PermissionsKit/Core'
- subspec.dependency 'PermissionsKit/LocationExtension'
- subspec.source_files = "Sources/LocationWhenInUsePermission/**/*.swift"
- subspec.pod_target_xcconfig = {
- "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION_WHENINUSE PERMISSIONSKIT_COCOAPODS"
- }
- end
-
- s.subspec 'LocationAlwaysPermission' do |subspec|
+ s.subspec 'LocationPermission' do |subspec|
subspec.dependency 'PermissionsKit/Core'
- subspec.dependency 'PermissionsKit/LocationExtension'
- subspec.source_files = "Sources/LocationAlwaysPermission/**/*.swift"
+ subspec.source_files = "Sources/LocationPermission/**/*.swift"
subspec.pod_target_xcconfig = {
- "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION_ALWAYS PERMISSIONSKIT_COCOAPODS"
+ "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "PERMISSIONSKIT_LOCATION PERMISSIONSKIT_COCOAPODS"
}
end
diff --git a/README.md b/README.md
index 678511fd..3752aa6b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# PermissionsKit
-Universal API for request permission and get its statuses. Available `.authorized`, `.denied` & `.notDetermined`.
+Universal API for request permission and get its statuses — available `.authorized`, `.denied` & `.notDetermined`.
@@ -21,17 +21,14 @@ Universal API for request permission and get its statuses. Available `.authorize
-### Community
+### iOS Dev Community
-
-
+
+
-
-
-
-
+
@@ -41,12 +38,12 @@ Universal API for request permission and get its statuses. Available `.authorize
- [Installation](#installation)
- [Swift Package Manager](#swift-package-manager)
- [CocoaPods](#cocoapods)
+ - [Why Modules](#why-modules)
- [Usage](#request-permission)
- [Request Permission](#request-permission)
- - [Status Permission](#status-permission)
+ - [Get Status Permission](#get-status-permission)
- [Keys in Info.plist](#keys-in-infoplist)
- [Localisations](#localisation)
-- [Apple Review](#apple-review)
- [Apps Using](#apps-using)
### Permissions
@@ -54,50 +51,50 @@ Universal API for request permission and get its statuses. Available `.authorize
| Icon | Permission | Key for `Info.plist` | Get Status | Make Request |
| :--: | :---------- | :------------------- | :--------: | :----------: |
|
| Bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | ✅ | ✅ |
-|
| Calendar | NSCalendarsUsageDescription | ✅ | ✅ |
+|
| Calendar | NSCalendarsUsageDescription, NSCalendarsFullAccessUsageDescription, NSCalendarsWriteOnlyAccessUsageDescription | ✅ | ✅ |
|
| Camera | NSCameraUsageDescription | ✅ | ✅ |
|
| Contacts | NSContactsUsageDescription | ✅ | ✅ |
-|
| FaceID | NSFaceIDUsageDescription | ✅ | ✅ |
+|
| FaceID | NSFaceIDUsageDescription | ☑️ | ✅ |
|
| Health | NSHealthUpdateUsageDescription, NSHealthShareUsageDescription | ✅ | ✅ |
-|
| Location Always | NSLocationAlwaysAndWhenInUseUsageDescription | ✅ | ✅ |
-|
| Location When In Use | NSLocationWhenInUseUsageDescription | ✅ | ✅ |
+|
| Location | NSLocationAlwaysAndWhenInUseUsageDescription NSLocationWhenInUseUsageDescription | ✅ | ✅ |
|
| Media Library | NSAppleMusicUsageDescription | ✅ | ✅ |
|
| Microphone | NSMicrophoneUsageDescription | ✅ | ✅ |
|
| Motion | NSMotionUsageDescription | ✅ | ✅ |
|
| Notification | | ✅ | ✅ |
|
| Photo Library | NSPhotoLibraryUsageDescription, NSPhotoLibraryAddUsageDescription | ✅ | ✅ |
-|
| Reminders | NSRemindersUsageDescription | ✅ | ✅ |
+|
| Reminders | NSRemindersUsageDescription, NSRemindersFullAccessUsageDescription | ✅ | ✅ |
|
| Siri | NSSiriUsageDescription | ✅ | ✅ |
|
| Speech Recognizer | NSSpeechRecognitionUsageDescription | ✅ | ✅ |
|
| Tracking | NSUserTrackingUsageDescription | ✅ | ✅ |
## Installation
-Ready to use on iOS 11+. Supports iOS, tvOS, and `SwiftUI`.
+Ready to use on iOS 12+. Supports iOS, macOS, visionOS, tvOS & watchOS. Working with `UIKit` and `SwiftUI`.
### Swift Package Manager
-In Xcode go to `File` -> `Packages` -> `Update to Latest Package Versions` and insert url:
+In Xcode go to Project -> Your Project Name -> `Package Dependencies` -> Tap *Plus*. Insert url:
```
https://github.com/sparrowcode/PermissionsKit
```
-or adding it to the `dependencies` value of your `Package.swift`:
+Next, choose the permissions that you need. But don't add all of them, because apple will reject app.
+Or adding it to the `dependencies` of your `Package.swift`:
```swift
dependencies: [
- .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "9.0.0"))
+ .package(url: "https://github.com/sparrowcode/PermissionsKit", .upToNextMajor(from: "11.0.0"))
]
```
-Next, choose the permissions you need. But don't add all of them, because apple [will reject app](#apple-review).
+and choose valid targets.
### CocoaPods:
-This is an outdated way of doing things. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time.
+This is an outdated way. I advise you to use [SPM](#swift-package-manager). However, I will continue to support Cocoapods for some time.
-Cocoapods Instalation
+Cocoapods Installation
[CocoaPods](https://cocoapods.org) is a dependency manager. For usage and installation instructions, visit their website. To integrate using CocoaPods, specify it in your `Podfile`:
@@ -116,8 +113,7 @@ pod 'PermissionsKit/NotificationPermission', :git => 'https://github.com/sparrow
pod 'PermissionsKit/MicrophonePermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
pod 'PermissionsKit/RemindersPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
pod 'PermissionsKit/SpeechRecognizerPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
-pod 'PermissionsKit/LocationWhenInUsePermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
-pod 'PermissionsKit/LocationAlwaysPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
+pod 'PermissionsKit/LocationPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
pod 'PermissionsKit/MotionPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
pod 'PermissionsKit/MediaLibraryPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
pod 'PermissionsKit/BluetoothPermission', :git => 'https://github.com/sparrowcode/PermissionsKit'
@@ -128,18 +124,25 @@ pod 'PermissionsKit/HealthPermission', :git => 'https://github.com/sparrowcode/P
```
+## Why Modules
+
+If you put all your code into one package and compile it, the Apple Review Team will see a lot of calls to the permissions API. Most likely, they will ask you to provide a valid reason for why you really need those permissions. Using modules allows you to compile only the parts of the code that are actually in use. Just select only what you need.
+
+> [!WARNING]
+> Import only the permissions you really need.
+
## Request Permission
```swift
import PermissionsKit
import NotificationPermission
-Permission.notification.request {
-
+PermissionsKit.Permission.notification([.alert, .badge, .sound]).request {
+
}
```
-## Status Permission
+## Get Status Permission
```swift
import PermissionsKit
@@ -148,15 +151,19 @@ import NotificationPermission
let authorized = Permission.notification.authorized
```
-## Keys in Info.plist
+> [!WARNING]
+> For FaceID permission no way detect if request `.authorized` or `.notDetermined` accurate. Status `.denied` detect well. For now for both states return `.notDetermined`.
+
+## Keys in `Info.plist`
-You need to add some keys to the `Info.plist` file with descriptions, per Apple's requirements. You can get a plist of keys for permissions as follows:
+You need to add some strings to the `Info.plist` file with descriptions per Apple's requirements. You can get a plist of keys for permissions as follows:
```swift
let key = Permission.bluetooth.usageDescriptionKey
```
-Do not use the description as the name of the key.
+> [!NOTE]
+> Do not use the description as the name of the key. Xcode can't build this.
### Localisation
@@ -166,31 +173,21 @@ If you use xliff localization export, keys will be create automatically. If you
"NSCameraUsageDescription" = "Here description of usage camera";
```
-## Apple Review
-
-Apple changed its review guidelines in June 2021. When requesting permissions, apps should require users to always request and make a decision whether to allow or decline the permission. For this reason, the close button in `PermissionsKit` is hidden by default. If you want to force show the close button, run the following code:
-
-```swift
-// Show & hide close button
-controller.showCloseButton = true
-
-// Enable or Disable drag intercation
-controller.allowSwipeDismiss = true
-```
-
-Also changed the title for the button. Instead of `allow` now use `continue`. The Apple Review Team asked for this. For details, check out [this issue](https://github.com/sparrowcode/PermissionsKit/issues/229).
-
## Apps Using
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-If you use a `PermissionsKit`, add your application via Pull Request.
+If you use a `PermissionsKit`, add your app via Pull Request.
diff --git a/Sources/BluetoothPermission/BluetoothHandler.swift b/Sources/BluetoothPermission/BluetoothHandler.swift
index 20c8d894..8421f49d 100644
--- a/Sources/BluetoothPermission/BluetoothHandler.swift
+++ b/Sources/BluetoothPermission/BluetoothHandler.swift
@@ -49,7 +49,16 @@ class BluetoothHandler: NSObject, CBCentralManagerDelegate {
func centralManagerDidUpdateState(_ central: CBCentralManager) {
if #available(iOS 13.0, tvOS 13, *) {
- switch central.authorization {
+
+ let authorization: CBManagerAuthorization = {
+ #if os(visionOS)
+ return CBManager.authorization
+ #else
+ return central.authorization
+ #endif
+ }()
+
+ switch authorization {
case .notDetermined:
break
default:
diff --git a/Sources/CalendarPermission/CalendarPermission.swift b/Sources/CalendarPermission/CalendarPermission.swift
index cf5efc3b..f7aa2286 100644
--- a/Sources/CalendarPermission/CalendarPermission.swift
+++ b/Sources/CalendarPermission/CalendarPermission.swift
@@ -28,35 +28,110 @@ import Foundation
import EventKit
public extension Permission {
-
- static var calendar: CalendarPermission {
- return CalendarPermission()
+
+ static func calendar(access: CalendarAccess) -> CalendarPermission {
+ CalendarPermission(kind: .calendar(access: access))
}
}
public class CalendarPermission: Permission {
- open override var kind: Permission.Kind { .calendar }
- open var usageDescriptionKey: String? { "NSCalendarsUsageDescription" }
+ private var _kind: Permission.Kind
+
+ // MARK: - Init
+
+ init(kind: Permission.Kind) {
+ self._kind = kind
+ }
+
+ open override var kind: Permission.Kind { self._kind }
+ open var usageDescriptionKey: String? {
+ if #available(iOS 17, *) {
+ switch kind {
+ case .calendar(let access):
+ switch access {
+ case .full:
+ return "NSCalendarsFullAccessUsageDescription"
+ case .write:
+ return "NSCalendarsWriteOnlyAccessUsageDescription"
+ }
+ default:
+ fatalError()
+ }
+ } else {
+ return "NSCalendarsUsageDescription"
+ }
+ }
public override var status: Permission.Status {
+ // Fix when status first time response with other state.
+ let _ = EKEventStore.authorizationStatus(for: EKEntityType.event)
+
switch EKEventStore.authorizationStatus(for: EKEntityType.event) {
case .authorized: return .authorized
case .denied: return .denied
+ case .fullAccess: return .authorized
case .notDetermined: return .notDetermined
case .restricted: return .denied
+ case .writeOnly:
+ if #available(iOS 17, *) {
+ switch kind {
+ case .calendar(let access):
+ switch access {
+ case .full:
+ return .denied
+ case .write:
+ return .authorized
+ }
+ default:
+ fatalError()
+ }
+ } else {
+ return .authorized
+ }
@unknown default: return .denied
}
}
public override func request(completion: @escaping () -> Void) {
+
let eventStore = EKEventStore()
- eventStore.requestAccess(to: EKEntityType.event, completion: {
- (accessGranted: Bool, error: Error?) in
- DispatchQueue.main.async {
- completion()
+
+ if #available(iOS 17.0, *) {
+
+ let requestWriteOnly = {
+ eventStore.requestWriteOnlyAccessToEvents { (accessGranted: Bool, error: Error?) in
+ DispatchQueue.main.async {
+ completion()
+ }
+ }
+ }
+
+ let requestFull = {
+ eventStore.requestFullAccessToEvents { (accessGranted: Bool, error: Error?) in
+ DispatchQueue.main.async {
+ completion()
+ }
+ }
}
- })
+
+ switch kind {
+ case .calendar(let access):
+ if access == .write {
+ requestWriteOnly()
+ } else {
+ requestFull()
+ }
+ default:
+ requestFull()
+ }
+ } else {
+ eventStore.requestAccess(to: EKEntityType.event) { (accessGranted: Bool, error: Error?) in
+ DispatchQueue.main.async {
+ completion()
+ }
+ }
+ }
}
}
#endif
diff --git a/Sources/ContactsPermission/ContactsPermission.swift b/Sources/ContactsPermission/ContactsPermission.swift
index 73597de9..45cfc1ff 100644
--- a/Sources/ContactsPermission/ContactsPermission.swift
+++ b/Sources/ContactsPermission/ContactsPermission.swift
@@ -40,7 +40,11 @@ public class ContactsPermission: Permission {
open var usageDescriptionKey: String? { "NSContactsUsageDescription" }
public override var status: Permission.Status {
- switch CNContactStore.authorizationStatus(for: .contacts) {
+ let authorizationStatus = CNContactStore.authorizationStatus(for: .contacts)
+ if #available(iOS 18.0, *), authorizationStatus == .limited {
+ return .authorized
+ }
+ switch authorizationStatus {
case .authorized: return .authorized
case .denied: return .denied
case .notDetermined: return .notDetermined
diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift b/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift
deleted file mode 100644
index 7c244a25..00000000
--- a/Sources/LocationAlwaysPermission/LocationAlwaysPermission.swift
+++ /dev/null
@@ -1,89 +0,0 @@
-// The MIT License (MIT)
-// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-#if PERMISSIONSKIT_SPM
-import PermissionsKit
-import LocationExtension
-#endif
-
-#if os(iOS) && PERMISSIONSKIT_LOCATION_ALWAYS
-import Foundation
-import MapKit
-
-public extension Permission {
-
- static var locationAlways: LocationAlwaysPermission {
- return LocationAlwaysPermission()
- }
-}
-
-public class LocationAlwaysPermission: Permission {
-
- open override var kind: Permission.Kind { .locationAlways }
- open var usageDescriptionKey: String? { "NSLocationAlwaysAndWhenInUseUsageDescription" }
-
- public override var status: Permission.Status {
- let authorizationStatus: CLAuthorizationStatus = {
- let locationManager = CLLocationManager()
- if #available(iOS 14.0, tvOS 14.0, *) {
- return locationManager.authorizationStatus
- } else {
- return CLLocationManager.authorizationStatus()
- }
- }()
-
- switch authorizationStatus {
- #if os(iOS)
- case .authorized: return .authorized
- #endif
- case .denied: return .denied
- case .notDetermined: return .notDetermined
- case .restricted: return .denied
- case .authorizedAlways: return .authorized
- case .authorizedWhenInUse: return .denied
- @unknown default: return .denied
- }
- }
-
- public var isPrecise: Bool {
- #if os(iOS)
- if #available(iOS 14.0, *) {
- switch CLLocationManager().accuracyAuthorization {
- case .fullAccuracy: return true
- case .reducedAccuracy: return false
- @unknown default: return false
- }
- }
- #endif
- return false
- }
-
- public override func request(completion: @escaping () -> Void) {
- LocationAlwaysHandler.shared = LocationAlwaysHandler()
- LocationAlwaysHandler.shared?.requestPermission() {
- DispatchQueue.main.async {
- completion()
- LocationAlwaysHandler.shared = nil
- }
- }
- }
-}
-#endif
diff --git a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift b/Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift
similarity index 90%
rename from Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift
rename to Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift
index 89740b2e..b0342fdc 100644
--- a/Sources/LocationAlwaysPermission/LocationAlwaysHandler.swift
+++ b/Sources/LocationPermission/Handlers/LocationAlwaysHandler.swift
@@ -21,10 +21,9 @@
#if PERMISSIONSKIT_SPM
import PermissionsKit
-import LocationExtension
#endif
-#if os(iOS) && PERMISSIONSKIT_LOCATION_ALWAYS
+#if os(iOS) && PERMISSIONSKIT_LOCATION
import Foundation
import MapKit
@@ -40,6 +39,14 @@ class LocationAlwaysHandler: NSObject, CLLocationManagerDelegate {
}
completionHandler()
}
+
+ @available(iOS 14.0, *)
+ func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
+ if manager.authorizationStatus == .notDetermined {
+ return
+ }
+ completionHandler()
+ }
// MARK: - Process
diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift
similarity index 78%
rename from Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift
rename to Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift
index 6a0a6526..22d73e69 100644
--- a/Sources/LocationWhenInUsePermission/LocationWhenInUseHandler.swift
+++ b/Sources/LocationPermission/Handlers/LocationWhenInUseHandler.swift
@@ -21,10 +21,9 @@
#if PERMISSIONSKIT_SPM
import PermissionsKit
-import LocationExtension
#endif
-#if PERMISSIONSKIT_LOCATION_WHENINUSE
+#if PERMISSIONSKIT_LOCATION
import Foundation
import MapKit
@@ -34,12 +33,23 @@ class LocationWhenInUseHandler: NSObject, CLLocationManagerDelegate {
lazy var locationManager = CLLocationManager()
+ #if !os(visionOS)
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
if status == .notDetermined {
return
}
completionHandler()
}
+ #endif
+
+
+ @available(iOS 14.0, macOS 11.0, watchOS 7.0, tvOS 14.0, visionOS 1.0, *)
+ func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
+ if manager.authorizationStatus == .notDetermined {
+ return
+ }
+ completionHandler()
+ }
// MARK: - Process
@@ -48,7 +58,16 @@ class LocationWhenInUseHandler: NSObject, CLLocationManagerDelegate {
func requestPermission(_ completionHandler: @escaping () -> Void) {
self.completionHandler = completionHandler
- let status = CLLocationManager.authorizationStatus()
+ let status: CLAuthorizationStatus = {
+ #if os(visionOS)
+ locationManager.authorizationStatus
+ #elseif os(macOS)
+ locationManager.authorizationStatus
+ #else
+ CLLocationManager.authorizationStatus()
+ #endif
+ }()
+
switch status {
case .notDetermined:
locationManager.delegate = self
diff --git a/Sources/LocationExtension/LocationAccuracy.swift b/Sources/LocationPermission/LocationAccuracy.swift
similarity index 97%
rename from Sources/LocationExtension/LocationAccuracy.swift
rename to Sources/LocationPermission/LocationAccuracy.swift
index db765f94..1a63ba18 100644
--- a/Sources/LocationExtension/LocationAccuracy.swift
+++ b/Sources/LocationPermission/LocationAccuracy.swift
@@ -24,7 +24,7 @@ import MapKit
extension CLLocationManager {
- open func setAccuracy(_ value: LocationAccuracy) {
+ public func setAccuracy(_ value: LocationAccuracy) {
desiredAccuracy = value.coreLocationAccuracy
}
}
diff --git a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift b/Sources/LocationPermission/LocationPermission.swift
similarity index 55%
rename from Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift
rename to Sources/LocationPermission/LocationPermission.swift
index effc7d51..2bd99124 100644
--- a/Sources/LocationWhenInUsePermission/LocationWhenInUsePermission.swift
+++ b/Sources/LocationPermission/LocationPermission.swift
@@ -21,24 +21,43 @@
#if PERMISSIONSKIT_SPM
import PermissionsKit
-import LocationExtension
#endif
-#if PERMISSIONSKIT_LOCATION_WHENINUSE
+#if os(iOS) && PERMISSIONSKIT_LOCATION
import Foundation
-import MapKit
+import EventKit
public extension Permission {
- static var locationWhenInUse: LocationWhenInUsePermission {
- return LocationWhenInUsePermission()
+ static func location(access: LocationAccess) -> LocationPermission {
+ LocationPermission(kind: .location(access: access))
}
}
-public class LocationWhenInUsePermission: Permission {
+public class LocationPermission: Permission {
- open override var kind: Permission.Kind { .locationWhenInUse }
- open var usageDescriptionKey: String? { "NSLocationAlwaysAndWhenInUseUsageDescription" }
+ private var _kind: Permission.Kind
+
+ // MARK: - Init
+
+ init(kind: Permission.Kind) {
+ self._kind = kind
+ }
+
+ open override var kind: Permission.Kind { self._kind }
+ open var usageDescriptionKey: String? {
+ switch _kind {
+ case .location(let access):
+ switch access {
+ case .whenInUse:
+ return "NSLocationWhenInUseUsageDescription"
+ case .always:
+ return "NSLocationAlwaysAndWhenInUseUsageDescription"
+ }
+ default:
+ fatalError()
+ }
+ }
public override var status: Permission.Status {
let authorizationStatus: CLAuthorizationStatus = {
@@ -57,8 +76,16 @@ public class LocationWhenInUsePermission: Permission {
case .denied: return .denied
case .notDetermined: return .notDetermined
case .restricted: return .denied
- case .authorizedAlways: return .authorized
- case .authorizedWhenInUse: return .authorized
+ case .authorizedAlways:
+ if case .location(let access) = _kind, access == .always {
+ return .authorized
+ }
+ return .denied
+ case .authorizedWhenInUse:
+ if case .location(let access) = _kind, access == .whenInUse {
+ return .authorized
+ }
+ return .denied
@unknown default: return .denied
}
}
@@ -77,12 +104,28 @@ public class LocationWhenInUsePermission: Permission {
}
public override func request(completion: @escaping () -> Void) {
- LocationWhenInUseHandler.shared = LocationWhenInUseHandler()
- LocationWhenInUseHandler.shared?.requestPermission() {
- DispatchQueue.main.async {
- completion()
- LocationWhenInUseHandler.shared = nil
+ switch _kind {
+ case .location(let access):
+ switch access {
+ case .whenInUse:
+ LocationWhenInUseHandler.shared = LocationWhenInUseHandler()
+ LocationWhenInUseHandler.shared?.requestPermission() {
+ DispatchQueue.main.async {
+ completion()
+ LocationWhenInUseHandler.shared = nil
+ }
+ }
+ case .always:
+ LocationAlwaysHandler.shared = LocationAlwaysHandler()
+ LocationAlwaysHandler.shared?.requestPermission() {
+ DispatchQueue.main.async {
+ completion()
+ LocationAlwaysHandler.shared = nil
+ }
+ }
}
+ default:
+ fatalError()
}
}
}
diff --git a/Sources/MicrophonePermission/MicrophonePermission.swift b/Sources/MicrophonePermission/MicrophonePermission.swift
index 50a02a99..493b3240 100644
--- a/Sources/MicrophonePermission/MicrophonePermission.swift
+++ b/Sources/MicrophonePermission/MicrophonePermission.swift
@@ -23,7 +23,7 @@
import PermissionsKit
#endif
-#if os(iOS) && PERMISSIONSKIT_MICROPHONE
+#if (os(iOS) || os(macOS)) && PERMISSIONSKIT_MICROPHONE
import Foundation
import AVFoundation
@@ -40,21 +40,39 @@ public class MicrophonePermission: Permission {
open var usageDescriptionKey: String? { "NSMicrophoneUsageDescription" }
public override var status: Permission.Status {
+ #if os(iOS)
switch AVAudioSession.sharedInstance().recordPermission {
case .granted: return .authorized
case .denied: return .denied
case .undetermined: return .notDetermined
@unknown default: return .denied
}
+ #elseif os(macOS)
+ switch AVCaptureDevice.authorizationStatus(for: .audio) {
+ case .denied: return .denied
+ case .notDetermined: return .notDetermined
+ case .restricted: return .denied
+ case .authorized: return .authorized
+ @unknown default: return .denied
+ }
+ #endif
}
public override func request(completion: @escaping () -> Void) {
+ #if os(iOS)
AVAudioSession.sharedInstance().requestRecordPermission {
granted in
DispatchQueue.main.async {
completion()
}
}
+ #elseif os(macOS)
+ AVCaptureDevice.requestAccess(for: .audio) { _ in
+ DispatchQueue.main.async {
+ completion()
+ }
+ }
+ #endif
}
}
#endif
diff --git a/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift
new file mode 100644
index 00000000..cbb90269
--- /dev/null
+++ b/Sources/NotificationPermission/NotificationAccess+userNotifcationAuthorizationOptions.swift
@@ -0,0 +1,57 @@
+// The MIT License (MIT)
+// Copyright © 2022 Sparrow Code LTD (https://sparrowcode.io, hello@sparrowcode.io)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+import PermissionsKit
+import UserNotifications
+
+extension Permission.NotificationAccess {
+
+ var userNotifcationAuthorizationOptions: UNAuthorizationOptions {
+ switch self {
+ case .badge:
+ .badge
+ case .sound:
+ .sound
+ case .alert:
+ .alert
+ case .carPlay:
+ .carPlay
+ case .criticalAlert:
+ .criticalAlert
+ case .providesAppNotificationSettings:
+ .providesAppNotificationSettings
+ case .provisional:
+ .provisional
+ case .announcement:
+ if #available(iOS 13.0, watchOS 6.0, *) {
+ .announcement
+ } else {
+ .alert
+ }
+ case .timeSensitive:
+ if #available(iOS 15.0, tvOS 15.0, watchOS 8.0, *) {
+ .timeSensitive
+ } else {
+ .alert
+ }
+ }
+ }
+}
diff --git a/Sources/NotificationPermission/NotificationPermission.swift b/Sources/NotificationPermission/NotificationPermission.swift
index d2cb67ab..b9cc7782 100644
--- a/Sources/NotificationPermission/NotificationPermission.swift
+++ b/Sources/NotificationPermission/NotificationPermission.swift
@@ -28,14 +28,19 @@ import UserNotifications
public extension Permission {
- static var notification: NotificationPermission {
- return NotificationPermission()
+ static func notification(_ access: Set = [.alert, .badge, .sound]) -> NotificationPermission {
+ return NotificationPermission(kind: .notification(access: access))
}
}
public class NotificationPermission: Permission {
- open override var kind: Permission.Kind { .notification }
+ private var _kind: Permission.Kind
+ open override var kind: Permission.Kind { self._kind }
+
+ init(kind: Permission.Kind) {
+ self._kind = kind
+ }
public override var status: Permission.Status {
guard let authorizationStatus = fetchAuthorizationStatus() else { return .notDetermined }
@@ -64,10 +69,15 @@ public class NotificationPermission: Permission {
public override func request(completion: @escaping () -> Void) {
let center = UNUserNotificationCenter.current()
- center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in
- DispatchQueue.main.async {
- completion()
+ switch _kind {
+ case .notification(let access):
+ center.requestAuthorization(options: UNAuthorizationOptions(access.map { $0.userNotifcationAuthorizationOptions })) { (granted, error) in
+ DispatchQueue.main.async {
+ completion()
+ }
}
+ default:
+ fatalError()
}
}
}
diff --git a/Sources/PermissionsKit/Data/Text.swift b/Sources/PermissionsKit/Data/Text.swift
index 9175c2ed..84c9d29d 100644
--- a/Sources/PermissionsKit/Data/Text.swift
+++ b/Sources/PermissionsKit/Data/Text.swift
@@ -19,7 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-import UIKit
+import Foundation
enum Texts {
@@ -31,7 +31,7 @@ enum Texts {
return NSLocalizedString("permission photoLibrary name", bundle: bundle, comment: "")
case .microphone:
return NSLocalizedString("permission microphone name", bundle: bundle, comment: "")
- case .calendar:
+ case .calendar(access: .full), .calendar(access: .write):
return NSLocalizedString("permission calendar name", bundle: bundle, comment: "")
case .contacts:
return NSLocalizedString("permission contacts name", bundle: bundle, comment: "")
@@ -47,9 +47,9 @@ enum Texts {
return NSLocalizedString("permission bluetooth name", bundle: bundle, comment: "")
case .notification:
return NSLocalizedString("permission notification name", bundle: bundle, comment: "")
- case .locationWhenInUse:
+ case .location(access: .whenInUse):
return NSLocalizedString("permission location when in use name", bundle: bundle, comment: "")
- case .locationAlways:
+ case .location(access: .always):
return NSLocalizedString("permission location always name", bundle: bundle, comment: "")
case .tracking:
return NSLocalizedString("permission tracking name", bundle: bundle, comment: "")
diff --git a/Sources/PermissionsKit/Permission.swift b/Sources/PermissionsKit/Permission.swift
index 5dd28f2b..cb50d2df 100644
--- a/Sources/PermissionsKit/Permission.swift
+++ b/Sources/PermissionsKit/Permission.swift
@@ -19,9 +19,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+import Foundation
+
+#if os(iOS)
import UIKit
+#endif
-open class Permission: Equatable {
+open class Permission {
open var authorized: Bool {
return status == .authorized
@@ -48,6 +52,7 @@ open class Permission: Equatable {
For most permissions its app page in settings app.
You can overide it if your permission need open custom page.
*/
+ #if os(iOS)
@available(iOSApplicationExtension, unavailable)
open func openSettingPage() {
DispatchQueue.main.async {
@@ -57,6 +62,7 @@ open class Permission: Equatable {
}
}
}
+ #endif
// MARK: Must Ovveride
@@ -78,41 +84,45 @@ open class Permission: Equatable {
// MARK: Internal
- public static func == (lhs: Permission, rhs: Permission) -> Bool {
- return lhs.kind == rhs.kind
- }
-
public init() {}
// MARK: - Models
- @objc public enum Status: Int {
+ @objc public enum Status: Int, CustomStringConvertible {
case authorized
case denied
case notDetermined
case notSupported
+
+ public var description: String {
+ switch self {
+ case .authorized: return "authorized"
+ case .denied: return "denied"
+ case .notDetermined: return "not determined"
+ case .notSupported: return "not supported"
+ }
+ }
}
- @objc public enum Kind: Int {
+ public enum Kind {
- case camera = 0
- case notification = 2
- case photoLibrary = 1
- case microphone = 3
- case calendar = 4
- case contacts = 5
- case reminders = 6
- case speech = 7
- case locationWhenInUse = 9
- case locationAlways = 10
- case motion = 11
- case mediaLibrary = 12
- case bluetooth = 13
- case tracking = 14
- case faceID = 15
- case siri = 16
- case health = 17
+ case camera
+ case notification(access: Set)
+ case photoLibrary
+ case microphone
+ case calendar(access: CalendarAccess)
+ case contacts
+ case reminders
+ case speech
+ case location(access: LocationAccess)
+ case motion
+ case mediaLibrary
+ case bluetooth
+ case tracking
+ case faceID
+ case siri
+ case health
public var name: String {
switch self {
@@ -122,7 +132,9 @@ open class Permission: Equatable {
return "Photo Library"
case .microphone:
return "Microphone"
- case .calendar:
+ case .calendar(access: .write):
+ return "Calendar Only Write"
+ case .calendar(access: .full):
return "Calendar"
case .contacts:
return "Contacts"
@@ -130,8 +142,10 @@ open class Permission: Equatable {
return "Reminders"
case .speech:
return "Speech"
- case .locationAlways:
+ case .location(access: .always):
return "Location Always"
+ case .location(access: .whenInUse):
+ return "Location When Use"
case .motion:
return "Motion"
case .mediaLibrary:
@@ -140,8 +154,6 @@ open class Permission: Equatable {
return "Bluetooth"
case .notification:
return "Notification"
- case .locationWhenInUse:
- return "Location When Use"
case .tracking:
return "Tracking"
case .faceID:
@@ -153,4 +165,32 @@ open class Permission: Equatable {
}
}
}
+
+ public enum CalendarAccess {
+
+ case full
+ case write
+ }
+
+ public enum LocationAccess {
+
+ case whenInUse
+ case always
+ }
+
+ public enum NotificationAccess {
+
+ case badge
+ case sound
+ case alert
+ case carPlay
+ case criticalAlert
+ case providesAppNotificationSettings
+ case provisional
+
+ @available(iOS, introduced: 13.0, deprecated: 15.0, message: "Only from iOS 13.0 to 15.0")
+ case announcement
+ @available(iOS, introduced: 15.0, deprecated: 15.0, message: "Only with iOS 15.0")
+ case timeSensitive
+ }
}
diff --git a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings
index 76af0ec5..93d7526a 100644
--- a/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/ar.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "استمرار";
-
-"action allowed" = "تم السماح";
-
-"titles header" = "إدارة الصلاحيات";
-
-"titles sub header" = "الصلاحيات";
-
-"titles description" = "هذه الصلاحيات التي يتطلبها التطبيق ليعمل بشكل صحيح.";
-
-"titles comment" = "منح الصلاحيات يمكنك من تحقيق أقصى إستفادة من مميزات التطبيق";
-
"permission camera name" = "الكاميرا";
-"permission camera description" = "السماح للتطبيق بالوصول الى الكاميرا";
-
"permission photoLibrary name" = "الاستوديو";
-"permission photoLibrary description" = "ليتمكن التطبيق من حفظ او استيراد الصور من والى الاستوديو";
-
"permission microphone name" = "المايكروفون";
-"permission microphone description" = "السماح بإستخدام المايكروفون";
-
"permission calendar name" = "التقويم";
-"permission calendar description" = "السماح بالوصول الكامل الى التقويم";
-
"permission contacts name" = "جهات الاتصال";
-"permission contacts description" = "الوصول إلى جهات الاتصال";
-
"permission reminders name" = "التذكيرات";
-"permission reminders description" = "السماح للتطبيق بالوصول الكامل الى التذكيرات";
-
-"permission speech name" = "التحدث";
-
-"permission speech description" = "السماح بالتحقق من صوتك";
+"permission speech name" = "التحدث";=
"permission motion name" = "الحركة";
-"permission motion description" = "السماح بتسجيل البيانات المتعلقة بالحركة والبيئة";
-
"permission media library name" = "الموسيقى";
-"permission media library description" = "السماح للوصول الى مكتبة الموسيقى";
-
"permission bluetooth name" = "البلوتوث";
-"permission bluetooth description" = "السماح بإستخدام البلوتوث";
-
"permission notification name" = "الإشعارات";
-"permission notification description" = "لإستقبال التنبيهات دون فتح التطبيق.";
-
"permission location when in use name" = "الموقع عند الاستخدام";
-"permission location when in use description" = "السماح للوصول إلى موقعك عند استخدام التطبيق فقط";
-
"permission location always name" = "الموقع دائما";
-"permission location always description" = "السماح دائماً للوصول إلى موقعك";
-
"permission tracking name" = "تتبع";
-"permission tracking description" = "السماح بالوصول إلى البيانات المتعلقة بالتطبيق";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "السماح باستخدام بصمة الوجه Face ID";
-
"permission siri name" = "سيري";
-"permission siri description" = "تمكين استخدام سيري";
-
"permission health name" = "الصحة";
-
-"permission health description" = "السماح بالوصول إلى البيانات الصحية";
-
-"denied alert title" = "تعديل الرفض";
-
-"denied alert description" = "لإعادة منح الصلاحيات يرجى الذهاب الى الإعدادات";
-
-"denied alert action" = "الذهاب الى الإعدادات";
-
-"denied alert cancel" = "الغاء";
-
-"action denied" = "تم الرفض";
diff --git a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings
index e0673f44..1c63b431 100644
--- a/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/de.lproj/Localizable.strings
@@ -1,89 +1,52 @@
-"action allow" = "Fortsetzen";
-"action allowed" = "Dürfen";
+"action allow" = "Erlauben";
-"titles header" = "Benötigen Sie die Erlaubnis";
+"action allowed" = "Berechtigt";
+
+"titles header" = "Geben Sie die Erlaubnis";
"titles sub header" = "Berechtigungsanfrage";
-"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um richtig zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung.";
+"titles description" = "Dies sind die Berechtigungen, die die App benötigt, um korrekt zu funktionieren. Bitte lesen Sie die Beschreibung für jede Berechtigung.";
-"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet. Push sind nicht erforderliche Berechtigungen";
+"titles comment" = "Berechtigungen sind notwendig, damit die Anwendung funktioniert und korrekt arbeitet.";
"permission camera name" = "Kamera";
-"permission camera description" = "App zur Verwendung der Kamera zulassen";
+"permission camera description" = "Zugriff auf die Kamera gewähren";
"permission photoLibrary name" = "Foto-Bibliothek";
-"permission photoLibrary description" = "Zugang zum Speichern von Fotos in Ihrer Galerie";
-
"permission microphone name" = "Mikrofon";
-"permission microphone description" = "Sprachaufzeichnung aus der App heraus zulassen";
-
"permission calendar name" = "Kalender";
-"permission calendar description" = "Anwendung kann Ereignisse zum Kalender hinzufügen";
-
"permission contacts name" = "Kontakte";
"permission contacts description" = "Zugriff für Ihre Kontakte und Telefone";
-"permission reminders name" = "Mahnungen";
-
-"permission reminders description" = "Anwendung kann neue Aufgabe erstellen";
+"permission reminders name" = "Erinnerungen";
"permission speech name" = "Sprechen";
-"permission speech description" = "Erlauben Sie die Überprüfung Ihrer Stimme";
-
"permission motion name" = "Bewegung";
-"permission motion description" = "Erlaubt die Aufzeichnung von bewegungs- und umgebungsbezogenen Daten";
-
"permission media library name" = "Medienbibliothek";
-"permission media library description" = "Erlauben Sie die Überprüfung Ihrer Medien";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Zugriff auf Bluetooth zulassen";
-
"permission notification name" = "Benachrichtigung";
-"permission notification description" = "Erhalten Sie wichtige Informationen, ohne die App zu öffnen.";
-
"permission location when in use name" = "Standort bei Verwendung";
-"permission location when in use description" = "Erlauben Sie den Zugriff auf Ihren Standort";
-
"permission location always name" = "Standort Immer";
-"permission location always description" = "Erlauben Sie den Zugriff auf Ihren Standort";
-
"permission tracking name" = "Nachverfolgung";
-"permission tracking description" = "Zugriff auf app-bezogene Daten zulassen";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Erlauben Sie die Verwendung der Face ID-Identität";
+"permission faceid description" = "Erlauben Sie die Verwendung von FaceID";
"permission siri name" = "Siri";
-"permission siri description" = "Sie werden Siri verwenden können";
-
"permission health name" = "Gesundheit";
-
-"permission health description" = "Zugriff auf Gesundheitsdaten zulassen";
-
-"denied alert title" = "Berechtigung verweigert";
-
-"denied alert description" = "Bitte gehen Sie zu Einstellungen und erlauben Sie die Erlaubnis.";
-
-"denied alert action" = "Einstellungen";
-
-"denied alert cancel" = "Abbrechen";
-
-"action denied" = "Abgelehnt";
diff --git a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings
index 7771ffab..634fc87d 100644
--- a/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/en.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Continue";
-
-"action allowed" = "Allowed";
-
-"titles header" = "Need Permission";
-
-"titles sub header" = "Permissions request";
-
-"titles description" = "These are the permissions the app requires to work properly. Please see description for each permission.";
-
-"titles comment" = "Permissions are necessary for the application to work and perform correctly. Push are not required permissions";
-
"permission camera name" = "Camera";
-"permission camera description" = "Allow app for use camera";
-
"permission photoLibrary name" = "Photo Library";
-"permission photoLibrary description" = "Access for save photos in your gallery";
-
"permission microphone name" = "Microphone";
-"permission microphone description" = "Allow record voice from app";
-
"permission calendar name" = "Calendar";
-"permission calendar description" = "Application can add events to calendar";
-
"permission contacts name" = "Contacts";
-"permission contacts description" = "Access for your contacts and phones";
-
"permission reminders name" = "Reminders";
-"permission reminders description" = "Application can create new task";
-
"permission speech name" = "Speech";
-"permission speech description" = "Allow to check your voice";
-
"permission motion name" = "Motion";
-"permission motion description" = "Allow to record motion and environment-related data";
-
"permission media library name" = "Media Library";
-"permission media library description" = "Allow to check your media";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Allow access to bluetooth";
-
"permission notification name" = "Notification";
-"permission notification description" = "Get important information without opening app.";
-
"permission location when in use name" = "Location When Use";
-"permission location when in use description" = "Allow to access your location";
-
"permission location always name" = "Location Always";
-"permission location always description" = "Allow to access your location";
-
"permission tracking name" = "Tracking";
-"permission tracking description" = "Allow to access app-related data";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Allow using Face ID identity";
-
"permission siri name" = "Siri";
-"permission siri description" = "You will be able to use Siri";
-
"permission health name" = "Health";
-
-"permission health description" = "Allow to access health data";
-
-"denied alert title" = "Permission denied";
-
-"denied alert description" = "Please, go to Settings and allow permission.";
-
-"denied alert action" = "Settings";
-
-"denied alert cancel" = "Cancel";
-
-"action denied" = "Denied";
diff --git a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings
index 18f7aec7..130b39c2 100644
--- a/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/es.lproj/Localizable.strings
@@ -1,90 +1,33 @@
-"action allow" = "Continuar";
-
-"action allowed" = "Permitido";
-
-"titles header" = "Necesita permiso";
-
-"titles sub header" = "Solicitud de permisos";
-
-"titles description" = "Estos son los permisos que la aplicación requiere para funcionar correctamente. Consulte la descripción de cada permiso.";
-
-"titles comment" = "Los permisos son necesarios para que la aplicación funcione y se desempeñe correctamente. Los permisos Push no son necesarios";
-
"permission camera name" = "Cámara";
-"permission camera description" = "Permitir que la aplicación utilice la cámara";
-
-"permission photoLibrary name" = "Biblioteca fotográfica";
-
-"permission photoLibrary description" = "Acceso para guardar fotos en tu galería";
+"permission photoLibrary name" = "Fotos";
"permission microphone name" = "Micrófono";
-"permission microphone description" = "Permitir la grabación de voz desde la aplicación";
-
"permission calendar name" = "Calendario";
-"permission calendar description" = "La aplicación puede añadir eventos al calendario";
-
"permission contacts name" = "Contactos";
-"permission contacts description" = "Acceso para sus contactos y teléfonos";
-
"permission reminders name" = "Recordatorios";
-"permission reminders description" = "La aplicación puede crear una nueva tarea";
-
"permission speech name" = "Discurso";
-"permission speech description" = "Permitir comprobar su voz";
-
"permission motion name" = "Movimiento";
-"permission motion description" = "Permite registrar datos relacionados con el movimiento y el entorno";
-
-"permission media library name" = "Biblioteca de medios de comunicación";
-
-"permission media library description" = "Permitir la comprobación de los medios de comunicación";
+"permission media library name" = "Contenidos y Apple music";
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Permitir el acceso al bluetooth";
-
-"permission notification name" = "Notificación";
-
-"permission notification description" = "Obtenga información importante sin abrir la aplicación.";
-
-"permission location when in use name" = "Ubicación cuando se usa";
-
-"permission location when in use description" = "Allow to access your location";
-
-"permission location always name" = "Ubicación Siempre";
-
-"permission location always description" = "Permitir el acceso a su ubicación
-";
+"permission notification name" = "Notificaciones";
-"permission tracking name" = "Seguimiento de";
+"permission location when in use name" = "Al usar la app";
-"permission tracking description" = "Permitir el acceso a los datos relacionados con la aplicación";
+"permission location always name" = "Siempre";
-"permission faceid name" = "FaceID";
+"permission tracking name" = "Rastreo";
-"permission faceid description" = "Permitir el uso de la identidad de Face ID";
+"permission faceid name" = "Face ID";
"permission siri name" = "Siri";
-"permission siri description" = "Podrá utilizar Siri";
-
"permission health name" = "Salud";
-
-"permission health description" = "Permitir el acceso a los datos de salud";
-
-"denied alert title" = "Permiso denegado";
-
-"denied alert description" = "Por favor, vaya a Configuración y permita el permiso.";
-
-"denied alert action" = "Ajustes";
-
-"denied alert cancel" = "Cancelar";
-
-"action denied" = "Negado";
diff --git a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings
index ac3330a3..ad487133 100644
--- a/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/fa.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "ادامه";
-
-"action allowed" = "مجاز";
-
-"titles header" = "نیاز به مجوز";
-
-"titles sub header" = "درخواست مجوز";
-
-"titles description" = "اینها مجوزهایی هستند که برنامه برای درست کار کردن نیاز دارد. لطفاً توضیحات مربوط به هر مجوز را ببینید.";
-
-"titles comment" = "مجوزها برای کار و عملکرد صحیح برنامه ضروری هستند. اعلانات مجوزهای ضروری نیستند";
-
"permission camera name" = "دوربین";
-"permission camera description" = "اجازه دادن به برنامه برای استفاده از دوربین";
-
"permission photoLibrary name" = "گالری";
-"permission photoLibrary description" = "دسترسی برای ذخیره عکس ها در گالری";
-
"permission microphone name" = "میکروفون";
-"permission microphone description" = "اجازه ضبط صدا به برنامه";
-
"permission calendar name" = "تقویم";
-"permission calendar description" = "برنامه می تواند رویدادها را به تقویم اضافه کند";
-
"permission contacts name" = "مخاطبین";
-"permission contacts description" = "دسترسی برای مخاطبین و تلفن های شما";
-
"permission reminders name" = "یادآوری ها";
-"permission reminders description" = "برنامه می تواند تسک جدیدی ایجاد کند";
-
"permission speech name" = "گفتار";
-"permission speech description" = "اجازه ضبط صدای شما";
-
"permission motion name" = "حرکت";
-"permission motion description" = "اجازه ضبط حرکت و داده های مربوط به محیط را فراهم می کند";
-
"permission media library name" = "مدیا";
-"permission media library description" = "اجازه بررسی مدیا شما";
-
"permission bluetooth name" = "بلوتوث";
-"permission bluetooth description" = "اجازه دسترسی به بلوتوث";
-
"permission notification name" = "اعلانات";
-"permission notification description" = "اطلاعات مهم را بدون باز کردن برنامه دریافت کنید.";
-
"permission location when in use name" = "موقعیت مکانی هنگام استفاده";
-"permission location when in use description" = "اجازه دسترسی به موقعیت مکانی شما";
-
"permission location always name" = "موقعیت مکانی همیشه";
-"permission location always description" = "اجازه دسترسی به موقعیت مکانی شما";
-
"permission tracking name" = "ردیابی";
-"permission tracking description" = "اجازه دسترسی به داده های مربوط به برنامه";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "اجازه استفاده از شناسه Face ID";
-
"permission siri name" = "سیری";
-"permission siri description" = "شما می توانید از سیری استفاده کنید";
-
"permission health name" = "سلامت";
-
-"permission health description" = "اجازه دسترسی به داده های سلامت";
-
-"denied alert title" = "مجوز رد شد";
-
-"denied alert description" = "لطفاً به تنظیمات بروید و مجوز بدهید.";
-
-"denied alert action" = "تنظیمات";
-
-"denied alert cancel" = "لغو";
-
-"action denied" = "رد شد";
diff --git a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings
index 5e834d09..3a66f72d 100644
--- a/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/fr.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Continuer";
-
-"action allowed" = "Autorisé";
-
-"titles header" = "Besoin d'une autorisation";
-
-"titles sub header" = "Demande de permissions";
-
-"titles description" = "Il s'agit des autorisations dont l'application a besoin pour fonctionner correctement. Veuillez consulter la description de chaque autorisation.";
-
-"titles comment" = "Les permissions sont nécessaires pour que l'application fonctionne et s'exécute correctement. Les permissions ne sont pas nécessaires";
-
"permission camera name" = "Caméra";
-"permission camera description" = "Autoriser l'application à utiliser la caméra";
-
"permission photoLibrary name" = "Photothèque";
-"permission photoLibrary description" = "Accès pour sauvegarder les photos dans votre galerie";
-
"permission microphone name" = "Microphone";
-"permission microphone description" = "Permet d'enregistrer la voix à partir de l'application";
-
"permission calendar name" = "Calendrier";
-"permission calendar description" = "L'application peut ajouter des événements au calendrier";
-
"permission contacts name" = "Contacts";
-"permission contacts description" = "Accès à vos contacts et téléphones";
-
"permission reminders name" = "Rappels";
-"permission reminders description" = "L'application peut créer une nouvelle tâche";
-
"permission speech name" = "Voix";
-"permission speech description" = "Permet de vérifier votre voix";
-
"permission motion name" = "Mouvement";
-"permission motion description" = "Permet d'enregistrer les mouvements et les données liées à l'environnement";
-
"permission media library name" = "Médiathèque";
-"permission media library description" = "Permet de vérifier vos médias";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Permet d'accéder à Bluetooth";
-
"permission notification name" = "Notification";
-"permission notification description" = "Obtenez des informations importantes sans ouvrir l'application.";
-
"permission location when in use name" = "Localisation lors de l'utilisation";
-"permission location when in use description" = "Autorisez l'accès à votre localisation";
-
"permission location always name" = "Localisation Toujours";
-"permission location always description" = "Autorisez l'accès à votre emplacement";
-
"permission tracking name" = "Suivi du site";
-"permission tracking description" = "Autoriser l'accès aux données liées à l'application";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Autoriser l'utilisation de l'identité Face ID";
-
"permission siri name" = "Siri";
-"permission siri description" = "Vous pourrez utiliser Siri";
-
"permission health name" = "Santé";
-
-"permission health description" = "Permettre d'accéder aux données de santé";
-
-"denied alert title" = "Permission refusée";
-
-"denied alert description" = "Veuillez aller dans Paramètres et autoriser la permission.";
-
-"denied alert action" = "Paramètres";
-
-"denied alert cancel" = "Annuler";
-
-"action denied" = "Refusé";
diff --git a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings
index 85cea273..3202089f 100644
--- a/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/it.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Continua";
-
-"action allowed" = "Permesso";
-
-"titles header" = "Need Permission";
-
-"titles sub header" = "Richiesta permessi";
-
-"titles description" = "Questi sono i permessi che l'app richiede per funzionare correttamente. Si prega di vedere la descrizione per ogni permesso";
-
-"titles comment" = "I permessi sono necessari affinché l'applicazione funzioni e funzioni correttamente. Spingere non sono permessi richiesti";
-
"permission camera name" = "Camera";
-"permission camera description" = "Permetti all'app di usare la fotocamera";
-
"permission photoLibrary name" = "Photo Library";
-"permission photoLibrary description" = "Accesso per salvare le foto nella tua galleria";
-
"permission microphone name" = "Microphone";
-"permission microphone description" = "Permettere di registrare la voce dall'app";
-
"permission calendar name" = "Calendar";
-"permission calendar description" = "L'applicazione può aggiungere eventi al calendario";
-
"permission contacts name" = "Contacts";
-"permission contacts description" = "Accesso per i tuoi contatti e telefoni";
-
"permission reminders name" = "Reminders";
-"permission reminders description" = "Application can create new task";
-
"permission speech name" = "Speech";
-"permission speech description" = "Permetti di controllare la tua voce";
-
"permission motion name" = "Motion";
-"permission motion description" = "Allow to record motion and environment-related data";
-
"permission media library name" = "Media Library";
-"permission media library description" = "Allow to check your media";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Permettere l'accesso al bluetooth";
-
"permission notification name" = "Notification";
-"permission notification description" = "Ottieni informazioni importanti senza aprire l'app";
-
"permission location when in use name" = "Location When Use";
-"permission location when in use description" = "Consenti l'accesso alla tua posizione";
-
"permission location always name" = "Posizione sempre";
-"permission location always description" = "Consenti di accedere alla tua posizione";
-
"permission tracking name" = "Tracking";
-"permission tracking description" = "Consenti di accedere ai dati relativi all'app";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Permettere di utilizzare l'identità di Face ID";
-
"permission siri name" = "Siri";
-"permission siri description" = "Sarà possibile utilizzare Siri";
-
"permission health name" = "Salute";
-
-"permission health description" = "Consenti l'accesso ai dati sanitari";
-
-"denied alert title" = "Permesso negato";
-
-"denied alert description" = "Per favore, vai su Impostazioni e autorizza il permesso";
-
-"denied alert action" = "Impostazioni";
-
-"denied alert cancel" = "Annulla";
-
-"action denied" = "Negato";
diff --git a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings
index 46e285f4..5c7fb784 100644
--- a/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/nl.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Doorgaan";
-
-"action allowed" = "Toegestaan";
-
-"titles header" = "Toestemming vereist";
-
-"titles sub header" = "Machtigingsverzoek";
-
-"titles description" = "Dit zijn de machtigingen die de app nodig heeft om goed te werken. Zie de beschrijving voor elke machtiging.";
-
-"titles comment" = "Machtigingen zijn nodig om de toepassing correct te laten werken en uit te voeren. Push zijn geen vereiste machtigingen";
-
"permission camera name" = "Camera";
-"permission camera description" = "App toestaan voor gebruik camera";
-
"permission photoLibrary name" = "Foto Bibliotheek";
-"permission photoLibrary description" = "Toegang om foto's in uw galerij op te slaan";
-
"permission microphone name" = "Microfoon";
-"permission microphone description" = "Opname stem vanuit app toestaan";
-
"permission calendar name" = "Kalender";
-"permission calendar description" = "Applicatie kan evenementen toevoegen aan kalender";
-
"permission contacts name" = "Contacten";
-"permission contacts description" = "Toegang tot uw contacten en telefoonnummers";
-
"permission reminders name" = "Herinneringen";
-"permission reminders description" = "Toepassing kan nieuwe taak maken";
-
"permission speech name" = "Spraak";
-"permission speech description" = "Sta toe om je stem te controleren";
-
"permission motion name" = "Beweging";
-"permission motion description" = "Sta toe om bewegings- en omgevingsgerelateerde gegevens op te nemen";
-
"permission media library name" = "Media Bibliotheek";
-"permission media library description" = "Toestaan om uw media te controleren";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Toegang tot bluetooth toestaan";
-
"permission notification name" = "Notificatie";
-"permission notification description" = "Krijg belangrijke informatie zonder de app te openen.";
-
"permission location when in use name" = "Locatie tijdens gebruik";
-"permission location when in use description" = "Toegang tot uw locatie toestaan";
-
"permission location always name" = "Locatie Altijd";
-"permission location always description" = "Toegang tot uw locatie toestaan";
-
"permission tracking name" = "Volgen";
-"permission tracking description" = "Toegang geven tot app-gerelateerde gegevens";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Gebruik van Face ID-identiteit toestaan";
-
"permission siri name" = "Siri";
-"permission siri description" = "U kunt Siri gebruiken";
-
"permission health name" = "Gezondheid";
-
-"permission health description" = "Toegang geven tot gezondheidsgegevens";
-
-"denied alert title" = "Toestemming geweigerd";
-
-"denied alert description" = "Ga naar Instellingen en geef toestemming.";
-
-"denied alert action" = "Instellingen";
-
-"denied alert cancel" = "Annuleren";
-
-"action denied" = "Afgewezen";
diff --git a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings
index b607ad17..a9711b45 100644
--- a/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/pl.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Kontyntynuj";
-
-"action allowed" = "Dozwolone";
-
-"titles header" = "Potrzebne zezwolenie";
-
-"titles sub header" = "Żądanie uprawnień";
-
-"titles description" = "To są uprawnienia, których aplikacja wymaga do poprawnego działania. Proszę zobaczyć opis dla każdego uprawnienia.";
-
-"titles comment" = "Uprawnienia są niezbędne do prawidłowego działania aplikacji. Push nie są wymagane uprawnienia";
-
"permission camera name" = "Kamera";
-"permission camera description" = "Zezwól aplikacji na korzystanie z aparatu";
-
"permission photoLibrary name" = "Biblioteka zdjęć";
-"permission photoLibrary description" = "Dostęp do zapisywania zdjęć w galerii";
-
"permission microphone name" = "Mikrofon";
-"permission microphone description" = "Umożliwia nagrywanie głosu z aplikacji";
-
"permission calendar name" = "Kalendarz";
-"permission calendar description" = "Aplikacja może dodawać wydarzenia do kalendarza";
-
"permission contacts name" = "Kontakty";
-"permission contacts description" = "Dostęp do kontaktów i telefonów";
-
"permission reminders name" = "Przypomnienia";
-"permission reminders description" = "Aplikacja może tworzyć nowe zadania";
-
"permission speech name" = "Mowa";
-"permission speech description" = "Umożliwia sprawdzanie głosu";
-
"permission motion name" = "Motion";
-"permission motion description" = "Umożliwia rejestrowanie ruchu i danych związanych z otoczeniem";
-
"permission media library name" = "Biblioteka mediów";
-"permission media library description" = "Umożliwia sprawdzanie multimediów.";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Zezwalaj na dostęp do bluetooth";
-
"permission notification name" = "Powiadomienia";
-"permission notification description" = "Otrzymuj ważne informacje bez otwierania aplikacji.";
-
"permission location when in use name" = "Lokalizacja podczas używania";
-"permission location when in use description" = "Zezwól na dostęp do swojej lokalizacji.";
-
"permission location always name" = "Lokalizacja zawsze";
-"permission location always description" = "Zezwalaj na dostęp do swojej lokalizacji";
-
"permission tracking name" = "Śledzenie";
-"permission tracking description" = "Zezwalaj na dostęp do danych związanych z aplikacją";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Zezwalaj na używanie tożsamości Face ID";
-
"permission siri name" = "Siri";
-"permission siri description" = "Będziesz mógł korzystać z Siri";
-
"permission health name" = "Zdrowie";
-
-"permission health description" = "Zezwalaj na dostęp do danych dotyczących zdrowia";
-
-"denied alert title" = "Odmowa pozwolenia";
-
-"denied alert description" = "Proszę przejść do Ustawień i zezwolić na dostęp.";
-
-"denied alert action" = "Ustawienia";
-
-"denied alert cancel" = "Anuluj";
-
-"action denied" = "Odmówiono";
diff --git a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings
index 3ed356d5..31757f9c 100644
--- a/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/pt.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Prosseguir";
-
-"action allowed" = "Permitido";
-
-"titles header" = "Necessidade de Permissão";
-
-"titles sub header" = "Pedido de permissões";
-
-"titles description" = "Estas são as permissões de que o aplicativo necessita para funcionar correctamente. Por favor, ver descrição de cada permissão.";
-
-"titles comment" = "As permissões são necessárias para que a aplicação funcione e funcione correctamente. Não são necessárias permissões para a aplicação.";
-
"permission camera name" = "Câmara";
-"permission camera description" = "Permitir o uso da câmara";
-
"permission photoLibrary name" = "Biblioteca de fotos";
-"permission photoLibrary description" = "Acesso para guardar fotos na sua galeria";
-
"permission microphone name" = "Microfone";
-"permission microphone description" = "Permitir a gravação de voz da app";
-
"permission calendar name" = "Calendário";
-"permission calendar description" = "A aplicação pode adicionar eventos ao calendário";
-
"permission contacts name" = "Contactos";
-"permission contacts description" = "Acesso para os seus contactos e telefones";
-
"permission reminders name" = "Lembretes";
-"permission reminders description" = "A aplicação pode criar uma nova tarefa";
-
"permission speech name" = "Discurso";
-"permission speech description" = "Permita verificar a sua voz";
-
"permission motion name" = "Moção";
-"permission motion description" = "Permitir o registo de movimentos e dados relacionados com o ambiente";
-
"permission media library name" = "Mediateca";
-"permission media library description" = "Permita verificar os seus meios de comunicação";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Permitir o acesso ao bluetooth";
-
"permission notification name" = "Notificação";
-"permission notification description" = "Obter informações importantes sem abrir a aplicação.";
-
"permission location when in use name" = "Localização Quando Usar";
-"permission location when in use description" = "Permitir o acesso à sua localização";
-
"permission location always name" = "Localização Sempre";
-"permission location always description" = "Permitir o acesso à sua localização";
-
"permission tracking name" = "Rastreamento";
-"permission tracking description" = "Permitir o acesso a dados relacionados com as aplicações";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Permitir a utilização da identidade de identificação facial";
-
"permission siri name" = "Siri";
-"permission siri description" = "Poderá utilizar o Siri";
-
"permission health name" = "Saúde";
-
-"permission health description" = "Permitir o acesso a dados de saúde";
-
-"denied alert title" = "Permissão negada";
-
-"denied alert description" = "Por favor, vá a Settings e permita a permissão.";
-
-"denied alert action" = "Definições";
-
-"denied alert cancel" = "Cancelar";
-
-"action denied" = "Negado";
diff --git a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings
index 7023c49c..cf060ded 100644
--- a/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/ru.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Разрешить";
-
-"action allowed" = "Готово";
-
-"titles header" = "Нужны разрешения";
-
-"titles sub header" = "Запрос";
-
-"titles description" = "Это разрешения, необходимые приложению для правильной работы. Гляньте описание каждого разрешения.";
-
-"titles comment" = "Разрешения необходимы для работы и правильной работы приложения. Уведомления не обязательны.";
-
"permission camera name" = "Камера";
-"permission camera description" = "Разрешить доступ приложения к камере.";
-
"permission photoLibrary name" = "Галерея";
-"permission photoLibrary description" = "Приложение сможет сохранять фото в галерею";
-
"permission microphone name" = "Микрофон";
-"permission microphone description" = "Приложение сможет записывать голос";
-
"permission calendar name" = "Календарь";
-"permission calendar description" = "Доступ к событиям в календаре";
-
"permission contacts name" = "Контакты";
-"permission contacts description" = "Доступ к контактам из телефонной книжки";
-
"permission reminders name" = "Напоминания";
-"permission reminders description" = "Приложение сможет создавать и редактировать напоминания";
-
"permission speech name" = "Распознавание Речи";
-"permission speech description" = "Приложение сможет анализировать вашу речь";
-
"permission motion name" = "Движение";
-"permission motion description" = "Позволяет записывать данные о движении и окружающей среде";
-
"permission media library name" = "Медиа библиотека";
-"permission media library description" = "Доступ к вашим медиа";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Приложение будет иметь доступ к Bluetooth";
-
"permission notification name" = "Уведомления";
-"permission notification description" = "Получайте важную информацию, не открывая приложение.";
-
"permission location when in use name" = "Локация, когда открыто приложение";
-"permission location when in use description" = "Разрешить доступ к вашему местоположению";
-
"permission location always name" = "Локация";
-"permission location always description" = "Разрешить доступ к вашему местоположению";
-
"permission tracking name" = "Отслеживание";
-"permission tracking description" = "Разрешить отслеживание с помощью рекламного идентификатора";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Разрешите идентификацию с помощью Face ID";
-
-"denied alert title" = "Разрешение заблокировано";
-
"permission siri name" = "Siri";
-"permission siri description" = "Вы сможете пользоваться Siri";
-
"permission health name" = "Здоровье";
-
-"permission health description" = "Разрешить доступ к данным о здоровье";
-
-"denied alert description" = "Пожалуйста, перейдите в настройки и измените доступ к разрешению.";
-
-"denied alert action" = "Открыть Настройки";
-
-"denied alert cancel" = "Отменить";
-
-"action denied" = "Отклонено";
diff --git a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings
index 5ede8020..35f5ead5 100644
--- a/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/uk.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "Дозвольте";
-
-"action allowed" = "Дозволено";
-
-"titles header" = "Потрібен дозвіл";
-
-"titles sub header" = "Запит на дозвіл";
-
-"titles description" = "Це дозволи, які вимагає програма для належної роботи. Будь ласка, див. Опис кожного дозволу.";
-
-"titles comment" = "Дозволи необхідні для того, щоб програма працювала та працювала правильно. Push не потрібні дозволи";
-
"permission camera name" = "Камера";
-"permission camera description" = "Дозволити програмі використовувати камеру";
-
"permission photoLibrary name" = "Фототека";
-"permission photoLibrary description" = "Доступ для збереження фотографій у вашій галереї";
-
"permission microphone name" = "Мікрофон";
-"permission microphone description" = "Дозволити записувати голос із програми";
-
"permission calendar name" = "Календар";
-"permission calendar description" = "Додаток може додавати події до календаря";
-
"permission contacts name" = "Контакти";
-"permission contacts description" = "Доступ для ваших контактів і телефонів";
-
"permission reminders name" = "Нагадування";
-"permission reminders description" = "Додаток може створити нове завдання";
-
"permission speech name" = "Мовлення";
-"permission speech description" = "Дозвольте перевірити свій голос";
-
"permission motion name" = "Рух";
-"permission motion description" = "Дозволити записувати дані про рух та навколишнє середовище";
-
"permission media library name" = "Медіатека";
-"permission media library description" = "Дозвольте перевірити медіа";
-
"permission bluetooth name" = "Bluetooth";
-"permission bluetooth description" = "Дозволити доступ до Bluetooth";
-
"permission notification name" = "Повідомлення";
-"permission notification description" = "Отримуйте важливу інформацію, не відкриваючи додаток.";
-
"permission location when in use name" = "Розташування під час використання";
-"permission location when in use description" = "Дозволити доступ до вашого місцезнаходження";
-
"permission location always name" = "Розташування Завжди";
-"permission location always description" = "Дозволити доступ до вашого місцезнаходження";
-
"permission tracking name" = "Відстеження";
-"permission tracking description" = "Дозволити доступ до даних, пов’язаних із додатками";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "Дозволити використання ідентифікатора обличчя Face ID";
-
-"denied alert title" = "Дозвіл відмовлено";
-
"permission siri name" = "Siri";
-"permission siri description" = "Ви зможете користуватися Siri";
-
"permission health name" = "Здоров'я";
-
-"permission health description" = "Дозволити доступ до даних про стан здоров’я";
-
-"denied alert description" = "Перейдіть у Налаштування та надайте дозвіл.";
-
-"denied alert action" = "Налаштування";
-
-"denied alert cancel" = "Скасувати";
-
-"action denied" = "Заперечується";
diff --git a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings
index d886a0c2..e9e48f6b 100644
--- a/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/zh-Hant.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "允許";
-
-"action allowed" = "已允許";
-
-"titles header" = "需要取用權限";
-
-"titles sub header" = "要求取用權限";
-
-"titles description" = "為了提供完整的服務,App 需要以下取用權限,請參考每個取用權限的說明。";
-
-"titles comment" = "App 需要取用權限才能得到最完整的體驗,推播通知不是必須的取用權限。";
-
"permission camera name" = "相機";
-"permission camera description" = "允許 App 使用相機";
-
"permission photoLibrary name" = "相簿";
-"permission photoLibrary description" = "允許 App 儲存照片到您的相簿";
-
"permission microphone name" = "麥克風";
-"permission microphone description" = "允許 App 錄音";
-
"permission calendar name" = "日曆";
-"permission calendar description" = "允許 App 新增行程至您的日曆";
-
"permission contacts name" = "通訊錄";
-"permission contacts description" = "允許 App 取用您的聯絡人和電話號碼";
-
"permission reminders name" = "提醒事項";
-"permission reminders description" = "允許 App 新增提醒事項";
-
"permission speech name" = "語音辨識";
-"permission speech description" = "允許 App 分析您的聲音";
-
"permission motion name" = "運動";
-"permission motion description" = "允許紀錄運動與相關資料";
-
"permission media library name" = "媒體櫃";
-"permission media library description" = "允許取用您的媒體櫃";
-
"permission bluetooth name" = "藍芽";
-"permission bluetooth description" = "允許使用藍芽";
-
"permission notification name" = "推播通知";
-"permission notification description" = "在不打開 App 的情況下,取得重要通知";
-
"permission location when in use name" = "在使用 App 期間取用位置";
-"permission location when in use description" = "取用您的位置";
-
"permission location always name" = "總是取用位置";
-"permission location always description" = "取用您的位置";
-
"permission tracking name" = "追蹤";
-"permission tracking description" = "允許追蹤您在其他公司的 App 和網站上的活動";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "允許使用 Face ID";
-
"permission siri name" = "Siri";
-"permission siri description" = "您將能夠使用 Siri";
-
"permission health name" = "健康";
-
-"permission health description" = "允許取用健康的資料";
-
-"denied alert title" = "已拒絕取用";
-
-"denied alert description" = "請前往至「設定」並允許取用";
-
-"denied alert action" = "設定";
-
-"denied alert cancel" = "取消";
-
-"action denied" = "拒絕";
diff --git a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings b/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings
index 9d315ab8..6b7b5dc0 100644
--- a/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings
+++ b/Sources/PermissionsKit/Resources/Localization/zh_Hans.lproj/Localizable.strings
@@ -1,89 +1,33 @@
-"action allow" = "允许";
-
-"action allowed" = "已允许";
-
-"titles header" = "需要授权";
-
-"titles sub header" = "授权请求";
-
-"titles description" = "为了提供更好的服务, App 需要如下权限. 请参考每个权限的说明.";
-
-"titles comment" = "App 需要权限才能正常工作和执行. 推送通知不是必需的权限";
-
"permission camera name" = "相机";
-"permission camera description" = "允许 App 使用相机";
-
"permission photoLibrary name" = "照片图库";
-"permission photoLibrary description" = "允许 App 将照片保存到您的图库";
-
"permission microphone name" = "麦克风";
-"permission microphone description" = "允许 App 录制音频";
-
"permission calendar name" = "日历";
-"permission calendar description" = "允许 App 添加活动至您的日历";
-
"permission contacts name" = "通讯录";
-"permission contacts description" = "允许 App 获取您的联系人以及电话号码";
-
"permission reminders name" = "提醒事项";
-"permission reminders description" = "允许 App 创建新的事件";
-
"permission speech name" = "语音识别";
-"permission speech description" = "允许 App 分析您的语音";
-
"permission motion name" = "运动";
-"permission motion description" = "允许记录运动以及环境相关信息";
-
"permission media library name" = "媒体";
-"permission media library description" = "允许访问您的媒体";
-
"permission bluetooth name" = "蓝牙";
-"permission bluetooth description" = "允许使用蓝牙";
-
"permission notification name" = "通知";
-"permission notification description" = "不打开 App 情况下获取重要通知.";
-
"permission location when in use name" = "使用 App 期间访问位置";
-"permission location when in use description" = "访问您的位置";
-
"permission location always name" = "始终访问位置";
-"permission location always description" = "访问您的位置";
-
"permission tracking name" = "跟踪";
-"permission tracking description" = "允许访问 App 相关的数据";
-
"permission faceid name" = "FaceID";
-"permission faceid description" = "允许使用Face ID身份";
-
"permission siri name" = "Siri";
-"permission siri description" = "你将能够使用Siri";
-
"permission health name" = "健康";
-
-"permission health description" = "允许访问健康数据";
-
-"denied alert title" = "已拒绝授权";
-
-"denied alert description" = "请跳转至设置并允许授权";
-
-"denied alert action" = "设置";
-
-"denied alert cancel" = "取消";
-
-"action denied" = "拒绝";
diff --git a/Sources/RemindersPermission/RemindersPermission.swift b/Sources/RemindersPermission/RemindersPermission.swift
index bd04c4ef..77ab7716 100644
--- a/Sources/RemindersPermission/RemindersPermission.swift
+++ b/Sources/RemindersPermission/RemindersPermission.swift
@@ -38,25 +38,37 @@ public class RemindersPermission: Permission {
open override var kind: Permission.Kind { .reminders }
open var usageDescriptionKey: String? { "NSRemindersUsageDescription" }
+ open var usageFullAccessDescriptionKey: String? { "NSRemindersFullAccessUsageDescription" }
public override var status: Permission.Status {
switch EKEventStore.authorizationStatus(for: EKEntityType.reminder) {
case .authorized: return .authorized
case .denied: return .denied
+ case .fullAccess: return .authorized
case .notDetermined: return .notDetermined
case .restricted: return .denied
+ case .writeOnly: return .authorized
@unknown default: return .denied
}
}
public override func request(completion: @escaping () -> Void) {
+
let eventStore = EKEventStore()
- eventStore.requestAccess(to: EKEntityType.reminder, completion: {
- (accessGranted: Bool, error: Error?) in
- DispatchQueue.main.async {
- completion()
+
+ if #available(iOS 17.0, *) {
+ eventStore.requestFullAccessToReminders { (accessGranted: Bool, error: Error?) in
+ DispatchQueue.main.async {
+ completion()
+ }
}
- })
+ } else {
+ eventStore.requestAccess(to: EKEntityType.reminder) { (accessGranted: Bool, error: Error?) in
+ DispatchQueue.main.async {
+ completion()
+ }
+ }
+ }
}
}
#endif
diff --git a/Sources/SpeechRecognizerPermission/SpeechPermission.swift b/Sources/SpeechRecognizerPermission/SpeechPermission.swift
index 85924f27..f1e05578 100644
--- a/Sources/SpeechRecognizerPermission/SpeechPermission.swift
+++ b/Sources/SpeechRecognizerPermission/SpeechPermission.swift
@@ -23,7 +23,7 @@
import PermissionsKit
#endif
-#if os(iOS) && PERMISSIONSKIT_SPEECH
+#if (os(iOS) || os(macOS)) && PERMISSIONSKIT_SPEECH
import Foundation
import Speech
diff --git a/Sources/TrackingPermission/TrackingPermission.swift b/Sources/TrackingPermission/TrackingPermission.swift
index 29acd813..c88bc0f3 100644
--- a/Sources/TrackingPermission/TrackingPermission.swift
+++ b/Sources/TrackingPermission/TrackingPermission.swift
@@ -26,7 +26,7 @@ import PermissionsKit
#if PERMISSIONSKIT_TRACKING
import AppTrackingTransparency
-@available(iOS 14.5, tvOS 14.5, *)
+@available(iOS 14, tvOS 14, *)
public extension Permission {
static var tracking: TrackingPermission {
@@ -34,7 +34,7 @@ public extension Permission {
}
}
-@available(iOS 14.5, tvOS 14.5, *)
+@available(iOS 14, tvOS 14, *)
public class TrackingPermission: Permission {
open override var kind: Permission.Kind { .tracking }