Commit 3d0121e1 by azack Committed by GitHub

Issue #988: Provisional Notification Permissions Part 3/3 (#992)

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

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

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

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

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

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

---------

Co-authored-by: Maurits van Beusekom <maurits@vnbskm.nl>
parent 583e20d1
## 10.3.0
* Adds support for the "Provisional" permission status introduced with iOS 12+.
## 10.2.1 ## 10.2.1
* Fixes missing POST_NOTIFICATIONS permission in Android example project. * Fixes missing POST_NOTIFICATIONS permission in Android example project.
......
...@@ -164,7 +164,7 @@ You must list permission you want to use in your application : ...@@ -164,7 +164,7 @@ You must list permission you want to use in your application :
## How to use ## 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. 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 ```dart
var status = await Permission.camera.status; var status = await Permission.camera.status;
......
...@@ -70,6 +70,10 @@ extension PermissionCheckShortcuts on Permission { ...@@ -70,6 +70,10 @@ extension PermissionCheckShortcuts on Permission {
/// be showed to the user. Consuming Apps should redirect the user to the /// be showed to the user. Consuming Apps should redirect the user to the
/// App settings to change permissions. /// App settings to change permissions.
Future<bool> get isPermanentlyDenied => status.isPermanentlyDenied; 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. /// Actions that apply only to permissions that have an associated service.
......
...@@ -2,7 +2,7 @@ name: permission_handler ...@@ -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. 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 repository: https://github.com/baseflow/flutter-permission-handler
issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues
version: 10.2.1 version: 10.3.0
environment: environment:
sdk: ">=2.15.0 <4.0.0" sdk: ">=2.15.0 <4.0.0"
...@@ -23,9 +23,9 @@ dependencies: ...@@ -23,9 +23,9 @@ dependencies:
sdk: flutter sdk: flutter
meta: ^1.7.0 meta: ^1.7.0
permission_handler_android: ^10.2.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_windows: ^0.1.2
permission_handler_platform_interface: ^3.9.0 permission_handler_platform_interface: ^3.10.0
dev_dependencies: dev_dependencies:
flutter_lints: ^1.0.4 flutter_lints: ^1.0.4
......
...@@ -71,6 +71,12 @@ void main() { ...@@ -71,6 +71,12 @@ void main() {
expect(isPermanentlyDenied, false); expect(isPermanentlyDenied, false);
}); });
test('PermissionCheckShortcuts on Permission: get isProvisional',
() async {
final isProvisional = await Permission.calendar.isProvisional;
expect(isProvisional, false);
});
test( test(
// ignore: lines_longer_than_80_chars // ignore: lines_longer_than_80_chars
'ServicePermissionActions on PermissionWithService: get ServiceStatus returns the right service status', 'ServicePermissionActions on PermissionWithService: get ServiceStatus returns the right service status',
......
## 3.10.0 ## 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 ## 3.9.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment