Skip to content

Commit

Permalink
Added Siri Permission.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Jun 6, 2021
1 parent b32756a commit ed5c1d0
Show file tree
Hide file tree
Showing 27 changed files with 156 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ List of using for permissions:
- SPPERMISSIONS_LOCATION_WHENINUSE
- SPPERMISSIONS_LOCATION_ALWAYS
- SPPERMISSIONS_MOTION
- SPPERMISSIONS_MEDIALIBRARY
- SPPERMISSIONS_MUSIC
- SPPERMISSIONS_BLUETOOTH
- SPPERMISSIONS_TRACKING
- SPPERMISSIONS_SIRI

List of using for code manage:

Expand Down
3 changes: 2 additions & 1 deletion Example Apps/Dependencies/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ let package = Package(
.product(name: "SPPermissionsMusic", package: "SPPermissions"),
.product(name: "SPPermissionsBluetooth", package: "SPPermissions"),
.product(name: "SPPermissionsTracking", package: "SPPermissions"),
.product(name: "SPPermissionsFaceID", package: "SPPermissions")
.product(name: "SPPermissionsFaceID", package: "SPPermissions"),
.product(name: "SPPermissionsSiri", package: "SPPermissions")
]
),
]
Expand Down
8 changes: 6 additions & 2 deletions Example Apps/SPPermissions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
F47CBB0D265182DC00A8A00F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F47CBB0F265182DC00A8A00F /* RootControllers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootControllers.swift; sourceTree = "<group>"; };
F47CBB16265186CD00A8A00F /* RootControllerExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootControllerExtension.swift; sourceTree = "<group>"; };
F4C77E9E266D5A16001D5870 /* iOS Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "iOS Example.entitlements"; sourceTree = "<group>"; };
F4E350E32651BC8800D2CA45 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
F4FD4D2B2651008300B53BD9 /* SPPermissions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SPPermissions; path = ..; sourceTree = "<group>"; };
F4FD4D322651040300B53BD9 /* Dependencies */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Dependencies; sourceTree = "<group>"; };
Expand Down Expand Up @@ -133,6 +134,7 @@
F471BDB5264A5993000693BC /* iOS Example */ = {
isa = PBXGroup;
children = (
F4C77E9E266D5A16001D5870 /* iOS Example.entitlements */,
F471BDC8264A5B5F000693BC /* App */,
F471BDFC264A629A000693BC /* Data */,
F471BDFB264A6291000693BC /* Scenes */,
Expand Down Expand Up @@ -590,10 +592,11 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "iOS Example/iOS Example.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 8JMTA2AAF3;
DEVELOPMENT_TEAM = "";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -665,10 +668,11 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "iOS Example/iOS Example.entitlements";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 8JMTA2AAF3;
DEVELOPMENT_TEAM = "";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/ivanvorobei/SparrowKit",
"state": {
"branch": "main",
"revision": "21ca90ecf9cb95541a2fb0f9735ef1d8f484315a",
"revision": "9621aaf9698e91d540f0e67a44077c88cae630a3",
"version": null
}
}
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Example Apps/iOS Example/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import SparrowKit
class AppDelegate: SPAppWindowDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
makeKeyAndVisible(RootController().wrapToNavigationController(prefersLargeTitles: false), tint: .systemBlue)
makeKeyAndVisible(viewController: RootController().wrapToNavigationController(prefersLargeTitles: false), tint: .systemBlue)
return true
}
}
Expand Down
4 changes: 4 additions & 0 deletions Example Apps/iOS Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<string>Example Description</string>
<key>NSUserTrackingUsageDescription</key>
<string>Example Description</string>
<key>NSSiriUsageDescription</key>
<string>Example Description</string>
<key>NSFaceIDUsageDescription</key>
<string>Example Description</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
3 changes: 2 additions & 1 deletion Example Apps/iOS Example/Scenes/RootController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ import SPPermissionsMusic
import SPPermissionsBluetooth
import SPPermissionsTracking
import SPPermissionsFaceID
import SPPermissionsSiri

class RootController: SPTableViewController {

var availablePermissions: [SPPermissions.Permission] = [.camera, .photoLibrary, .notification, .microphone, .calendar, .contacts, .reminders, .speech, .locationWhenInUse, .locationAlways, .motion, .mediaLibrary, .bluetooth, /*.tracking,*/ .faceID]
var availablePermissions: [SPPermissions.Permission] = [.camera, .photoLibrary, .notification, .microphone, .calendar, .contacts, .reminders, .speech, .locationWhenInUse, .locationAlways, .motion, .mediaLibrary, .bluetooth, /*.tracking,*/ .faceID, .siri]

var selectedPermissions: [SPPermissions.Permission] = []

Expand Down
8 changes: 8 additions & 0 deletions Example Apps/iOS Example/iOS Example.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.siri</key>
<true/>
</dict>
</plist>
12 changes: 12 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ let package = Package(
name: "SPPermissionsFaceID",
targets: ["SPPermissionsFaceID"]
),
.library(
name: "SPPermissionsSiri",
targets: ["SPPermissionsSiri"]
),
],
dependencies: [],
targets: [
Expand Down Expand Up @@ -202,6 +206,14 @@ let package = Package(
.define("SPPERMISSIONS_FACEID"),
.define("SPPERMISSIONS_SPM")
]
),
.target(
name: "SPPermissionsSiri",
dependencies: [.target(name: "SPPermissions")],
swiftSettings: [
.define("SPPERMISSIONS_SIRI"),
.define("SPPERMISSIONS_SPM")
]
)
],
swiftLanguageVersions: [.v5]
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ If you like the project, don't forget to `put star ★` and follow me on GitHub:
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/bluetooth.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/tracking.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/faceid.png" width="38">
<img src="https://github.com/ivanvorobei/SPPermissions/blob/main/Assets/Permissions/siri.png" width="38">
</p>

## Navigate
Expand Down Expand Up @@ -135,6 +136,9 @@ pod 'SPPermissions/Tracking'
```ruby
pod 'SPPermissions/FaceID'
```
```ruby
pod 'SPPermissions/Siri'
```

</p>
</details>
Expand Down Expand Up @@ -366,6 +370,7 @@ List of keys:
- NSBluetoothPeripheralUsageDescription (iOS 12 and earlier)
- NSUserTrackingUsageDescription
- NSFaceIDUsageDescription
- NSSiriUsageDescription

Do not use the description as the name of the key.

Expand Down
2 changes: 1 addition & 1 deletion SPPermissions.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SPPermissions"
s.version = "6.4.5"
s.version = "6.4.6"
s.summary = "Ask permissions on Swift. Available List, Dialog & Native interface. Can check state permission."
s.homepage = "https://github.com/ivanvorobei/SPPermissions"
s.source = { :git => "https://github.com/ivanvorobei/SPPermissions.git", :tag => s.version }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class SPPermissionsDrawIconView: UIView {
Draw.drawBluetooth(frame: rect, resizing: .aspectFit, color: tintColor)
case .tracking:
Draw.drawTracking(frame: rect, resizing: .aspectFit, color: tintColor)
case .faceID:
case .faceID, .siri:
// Not implemented old style icons.
break
case .none:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "السماح باستخدام هوية Face ID";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "طلب الاذن مرفوض";

"denied alert description" = "من فضلك ، انتقل إلى الإعدادات واسمح بالإذن.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "Erlauben Sie die Verwendung der Face ID-Identität";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Berechtigung verweigert";

"denied alert description" = "Bitte gehen Sie zu Einstellungen und erlauben Sie die Erlaubnis.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "Allow using Face ID identity";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Permission denied";

"denied alert description" = "Please, go to Settings and allow permission.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@

"permission faceid description" = "Permitir el uso de la identidad de Face ID";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Permiso denegado";

"denied alert description" = "Por favor, vaya a Configuración y permita el permiso.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "Autoriser l'utilisation de l'identité Face ID";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Permission refusée";

"denied alert description" = "Veuillez aller dans Paramètres et autoriser la permission.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "Zezwalaj na używanie tożsamości Face ID";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Odmowa pozwolenia";

"denied alert description" = "Proszę przejść do Ustawień i zezwolić na dostęp.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "Permitir a utilização da identidade de identificação facial";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "Permissão negada";

"denied alert description" = "Por favor, vá a Settings e permita a permissão.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@

"denied alert title" = "Разрешение заблокировано";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert description" = "Пожалуйста, перейдите в настройки и измените доступ к разрешению.";

"denied alert action" = "Открыть Настройки";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@

"denied alert title" = "Дозвіл відмовлено";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert description" = "Перейдіть у Налаштування та надайте дозвіл.";

"denied alert action" = "Налаштування";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@

"permission faceid description" = "允许使用Face ID身份";

"permission siri name" = "Siri";

"permission siri description" = "You will be able to use Siri";

"denied alert title" = "已拒绝授权";

"denied alert description" = "请跳转至设置并允许授权";
Expand Down
3 changes: 3 additions & 0 deletions Sources/SPPermissions/SPPermissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public enum SPPermissions {
case bluetooth = 13
case tracking = 14
case faceID = 15
case siri = 16

public var name: String {
switch self {
Expand Down Expand Up @@ -207,6 +208,8 @@ public enum SPPermissions {
return "Tracking"
case .faceID:
return "FaceID"
case .siri:
return "Siri"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/SPPermissions/Services/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ enum Images {
return UIImage.init(named: "Tracking", in: bundle, compatibleWith: nil) ?? UIImage()
case .faceID:
return UIImage.init(named: "FaceID", in: bundle, compatibleWith: nil) ?? UIImage()
case .siri:
return UIImage.init(named: "Siri", in: bundle, compatibleWith: nil) ?? UIImage()
}
}

Expand Down
4 changes: 4 additions & 0 deletions Sources/SPPermissions/Services/Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ enum Texts {
return NSLocalizedString("permission tracking name", bundle: bundle, comment: "")
case .faceID:
return NSLocalizedString("permission faceid name", bundle: bundle, comment: "")
case .siri:
return NSLocalizedString("permission siri name", bundle: bundle, comment: "")
}
}

Expand Down Expand Up @@ -90,6 +92,8 @@ enum Texts {
return NSLocalizedString("permission tracking description", bundle: bundle, comment: "")
case .faceID:
return NSLocalizedString("permission faceid description", bundle: bundle, comment: "")
case .siri:
return NSLocalizedString("permission siri description", bundle: bundle, comment: "")
}
}

Expand Down
Loading

0 comments on commit ed5c1d0

Please sign in to comment.