Skip to content

Commit e0b76c2

Browse files
mvanbeusekomdupuchbaTimHoogstrate
authored
Add support for the Permission.assistant in all platforms. (#1267)
* Adding SiriKit permissions (#1140) * Adding SiriKit permissions * Fix tests --------- Co-authored-by: Maurits van Beusekom <maurits@vnbskm.nl> * Reserves the assistant permission on no-op platforms * Adds support to example application * Remove pubspec overrides * Fix formatting * Revert app facing package to main * Revert so only platform implementation changes are included * Add support for Permission.assistant to platforms * Update permission_handler_android/CHANGELOG.md Co-authored-by: TimHoogstrate <tim566@hotmail.com> * Update permission_handler_html/CHANGELOG.md Co-authored-by: TimHoogstrate <tim566@hotmail.com> * Update permission_handler_windows/CHANGELOG.md Co-authored-by: TimHoogstrate <tim566@hotmail.com> --------- Co-authored-by: Baptiste DUPUCH <baptiste.dupuch@gmail.com> Co-authored-by: TimHoogstrate <tim566@hotmail.com>
1 parent 0bf4d6f commit e0b76c2

File tree

21 files changed

+154
-19
lines changed

21 files changed

+154
-19
lines changed

permission_handler_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 12.0.3
2+
3+
* Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS or macOS).
4+
15
## 12.0.2
26

37
* Fixes bug where Android activity is leaked when embedded in native Android application.

permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionConstants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ final class PermissionConstants {
6060
static final int PERMISSION_GROUP_SENSORS_ALWAYS = 35;
6161
static final int PERMISSION_GROUP_CALENDAR_WRITE_ONLY = 36;
6262
static final int PERMISSION_GROUP_CALENDAR_FULL_ACCESS = 37;
63+
static final int PERMISSION_GROUP_ASSISTANT = 38;
6364

6465
@Retention(RetentionPolicy.SOURCE)
6566
@IntDef({
@@ -97,7 +98,8 @@ final class PermissionConstants {
9798
PERMISSION_GROUP_AUDIO,
9899
PERMISSION_GROUP_SCHEDULE_EXACT_ALARM,
99100
PERMISSION_GROUP_CALENDAR_WRITE_ONLY,
100-
PERMISSION_GROUP_CALENDAR_FULL_ACCESS
101+
PERMISSION_GROUP_CALENDAR_FULL_ACCESS,
102+
PERMISSION_GROUP_ASSISTANT
101103
})
102104
@interface PermissionGroup {
103105
}

permission_handler_android/example/lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class _PermissionHandlerWidgetState extends State<PermissionHandlerWidget> {
4141
permission != Permission.reminders &&
4242
permission != Permission.bluetooth &&
4343
permission != Permission.appTrackingTransparency &&
44-
permission != Permission.criticalAlerts;
44+
permission != Permission.criticalAlerts &&
45+
permission != Permission.assistant;
4546
})
4647
.map((permission) => PermissionWidget(permission))
4748
.toList()),

permission_handler_android/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: permission_handler_android
22
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
33
homepage: https://github.com/baseflow/flutter-permission-handler
4-
version: 12.0.2
4+
version: 12.0.3
55

66
environment:
77
sdk: ">=2.15.0 <4.0.0"
@@ -18,7 +18,7 @@ flutter:
1818
dependencies:
1919
flutter:
2020
sdk: flutter
21-
permission_handler_platform_interface: ^4.0.0
21+
permission_handler_platform_interface: ^4.1.0
2222

2323
dev_dependencies:
2424
flutter_lints: ^1.0.4

permission_handler_apple/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
## 9.3.0
2+
3+
* Adds support to request authorization to access SiriKit via the `Permission.assistant` permission.
4+
15
## 9.2.0
6+
27
* Adds the support for `Permission.calendarWriteOnly` and `Permission.calendarFullAccess` permissions which are introduced in iOS 17+.
38

49
## 9.1.4

permission_handler_apple/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

permission_handler_apple/example/ios/Podfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
2+
# platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -71,7 +71,7 @@ post_install do |installer|
7171

7272
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
7373
'PERMISSION_LOCATION=1',
74-
74+
7575
## dart: PermissionGroup.notification
7676
'PERMISSION_NOTIFICATIONS=1',
7777

@@ -89,6 +89,9 @@ post_install do |installer|
8989

9090
## dart: PermissionGroup.criticalAlerts
9191
'PERMISSION_CRITICAL_ALERTS=1',
92+
93+
## dart: PermissionGroup.criticalAlerts
94+
'PERMISSION_ASSISTANT=1',
9295
]
9396

9497
end

permission_handler_apple/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
C446183715B92022DDB68882 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4848
CEA40B36DE135D81D16B7399 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4949
DA7CB50DE8057A7A8D126AC9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
50+
F6BD02742B56D78D00C59EAA /* RunnerDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerDebug.entitlements; sourceTree = "<group>"; };
5051
/* End PBXFileReference section */
5152

5253
/* Begin PBXFrameworksBuildPhase section */
@@ -112,6 +113,7 @@
112113
97C146F01CF9000F007C117D /* Runner */ = {
113114
isa = PBXGroup;
114115
children = (
116+
F6BD02742B56D78D00C59EAA /* RunnerDebug.entitlements */,
115117
97C146FA1CF9000F007C117D /* Main.storyboard */,
116118
97C146FD1CF9000F007C117D /* Assets.xcassets */,
117119
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -342,7 +344,7 @@
342344
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343345
GCC_WARN_UNUSED_FUNCTION = YES;
344346
GCC_WARN_UNUSED_VARIABLE = YES;
345-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
347+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
346348
MTL_ENABLE_DEBUG_INFO = NO;
347349
SDKROOT = iphoneos;
348350
SUPPORTED_PLATFORMS = iphoneos;
@@ -428,7 +430,7 @@
428430
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
429431
GCC_WARN_UNUSED_FUNCTION = YES;
430432
GCC_WARN_UNUSED_VARIABLE = YES;
431-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
433+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
432434
MTL_ENABLE_DEBUG_INFO = YES;
433435
ONLY_ACTIVE_ARCH = YES;
434436
SDKROOT = iphoneos;
@@ -477,7 +479,7 @@
477479
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
478480
GCC_WARN_UNUSED_FUNCTION = YES;
479481
GCC_WARN_UNUSED_VARIABLE = YES;
480-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
482+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
481483
MTL_ENABLE_DEBUG_INFO = NO;
482484
SDKROOT = iphoneos;
483485
SUPPORTED_PLATFORMS = iphoneos;
@@ -494,6 +496,7 @@
494496
buildSettings = {
495497
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
496498
CLANG_ENABLE_MODULES = YES;
499+
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
497500
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
498501
DEVELOPMENT_TEAM = 7624MWN53C;
499502
ENABLE_BITCODE = NO;

permission_handler_apple/example/ios/Runner/Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@
101101
<!-- Permission options for the `appTrackingTransparency` -->
102102
<key>NSUserTrackingUsageDescription</key>
103103
<string>appTrackingTransparency</string>
104+
105+
<!-- Permission options for the `assistant` group -->
106+
<key>NSSiriUsageDescription</key>
107+
<string>The example app would like access to Siri Kit to demonstrate requesting authorization.</string>
108+
104109
<key>CADisableMinimumFrameDurationOnPhone</key>
105110
<true/>
106111
<key>UIApplicationSupportsIndirectInputEvents</key>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.siri</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)