Skip to content

Commit

Permalink
Issue Baseflow#988: Provisional Notification Permissions Part 3/3 (Ba…
Browse files Browse the repository at this point in the history
…seflow#992)

* Issue Baseflow#988: Updating platform interface for provisional permission status

* Issue Baseflow#988: Updating platform interface for provisional permission status - increasing test coverage

* Issue Baseflow#988: Updating platform interface for provisional permission status

* Issue Baseflow#988: Updating platform interface for provisional permission status

* Issue Baseflow#988: Updating platform interface for provisional permission status

* Issue Baseflow#988: Updating platform interface for provisional permission status

---------

Co-authored-by: Maurits van Beusekom <[email protected]>
  • Loading branch information
azack and mvanbeusekom authored Jun 7, 2023
1 parent 583e20d commit 3d0121e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions permission_handler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 10.3.0

* Adds support for the "Provisional" permission status introduced with iOS 12+.

## 10.2.1

* Fixes missing POST_NOTIFICATIONS permission in Android example project.
Expand Down
2 changes: 1 addition & 1 deletion permission_handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ You must list permission you want to use in your application :
## How to use

There are a number of [`Permission`](https://pub.dev/documentation/permission_handler_platform_interface/latest/permission_handler_platform_interface/Permission-class.html#constants)s.
You can get a `Permission`'s `status`, which is either `granted`, `denied`, `restricted` or `permanentlyDenied`.
You can get a `Permission`'s `status`, which is either `granted`, `denied`, `restricted`, `permanentlyDenied`, `limited`, or `provisional`.

```dart
var status = await Permission.camera.status;
Expand Down
4 changes: 4 additions & 0 deletions permission_handler/lib/permission_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ extension PermissionCheckShortcuts on Permission {
/// be showed to the user. Consuming Apps should redirect the user to the
/// App settings to change permissions.
Future<bool> get isPermanentlyDenied => status.isPermanentlyDenied;

/// If the application is provisionally authorized to post noninterruptive user notifications.
/// *Only supported on iOS.*
Future<bool> get isProvisional => status.isProvisional;
}

/// Actions that apply only to permissions that have an associated service.
Expand Down
6 changes: 3 additions & 3 deletions permission_handler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: permission_handler
description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
repository: https://github.com/baseflow/flutter-permission-handler
issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues
version: 10.2.1
version: 10.3.0

environment:
sdk: ">=2.15.0 <4.0.0"
Expand All @@ -23,9 +23,9 @@ dependencies:
sdk: flutter
meta: ^1.7.0
permission_handler_android: ^10.2.0
permission_handler_apple: ^9.0.7
permission_handler_apple: ^9.1.0
permission_handler_windows: ^0.1.2
permission_handler_platform_interface: ^3.9.0
permission_handler_platform_interface: ^3.10.0

dev_dependencies:
flutter_lints: ^1.0.4
Expand Down
6 changes: 6 additions & 0 deletions permission_handler/test/permission_handler_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ void main() {
expect(isPermanentlyDenied, false);
});

test('PermissionCheckShortcuts on Permission: get isProvisional',
() async {
final isProvisional = await Permission.calendar.isProvisional;
expect(isProvisional, false);
});

test(
// ignore: lines_longer_than_80_chars
'ServicePermissionActions on PermissionWithService: get ServiceStatus returns the right service status',
Expand Down
2 changes: 1 addition & 1 deletion permission_handler_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 3.10.0

* Adds support for iOS 12+ Provisional Notification permissions.
* Adds support for the "Provisional" permission status introduced with iOS 12+.

## 3.9.0

Expand Down

0 comments on commit 3d0121e

Please sign in to comment.