Skip to content

Commit 0bf4d6f

Browse files
mvanbeusekomdupuchbaTimHoogstrate
authored
Adds support to request SiriKit permissions to platform interface. (#1266)
* 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 to platforms to main * Revert so only platform interface changes are included * Update permission_handler_platform_interface/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 bb8e40a commit 0bf4d6f

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

permission_handler_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.1.0
2+
3+
* Adds the `Permission.assistant` which allows users to request permissions to access SiriKit on iOS and macOS platforms. This is a no-op on all other platforms.
4+
15
## 4.0.2
26

37
* Improved the documentation around the `PermissionStatus`, `PermissionStatusGetters` and `FuturePermissionStatusGetters`.

permission_handler_platform_interface/lib/src/permissions.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ class Permission {
319319
/// Permission for reading from and writing to the device's calendar.
320320
static const calendarFullAccess = Permission._(37);
321321

322+
/// Android: Nothing
323+
/// iOS: SiriKit
324+
static const assistant = Permission._(38);
325+
322326
/// Returns a list of all possible [PermissionGroup] values.
323327
static const List<Permission> values = <Permission>[
324328
// ignore: deprecated_member_use_from_same_package
@@ -360,6 +364,7 @@ class Permission {
360364
sensorsAlways,
361365
calendarWriteOnly,
362366
calendarFullAccess,
367+
assistant,
363368
];
364369

365370
static const List<String> _names = <String>[
@@ -401,6 +406,7 @@ class Permission {
401406
'sensorsAlways',
402407
'calendarWriteOnly',
403408
'calendarFullAccess',
409+
'assistant',
404410
];
405411

406412
@override

permission_handler_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin.
33
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
44
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6-
version: 4.0.2
6+
version: 4.1.0
77

88
dependencies:
99
flutter:

permission_handler_platform_interface/test/src/permissions_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ void main() {
66
() {
77
const values = Permission.values;
88

9-
expect(values.length, 38);
9+
expect(values.length, 39);
1010
});
1111

1212
test('check if byValue returns corresponding PermissionGroup value', () {

0 commit comments

Comments
 (0)