Commit bbcd26c3 by Maurits van Beusekom Committed by GitHub

Resolve unhandled exception on iOS (#1298)

parent 2db062fa
## 4.2.1
* Resolves an error that occurred when calling the `shouldShowRequestPermissionRationale` on iOS.
## 4.2.0
* Adds a new permission `Permission.backgroundRefresh` to check the background refresh permission status on iOS & macOS platforms. This is a no-op on all other platforms.
......
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import '../../permission_handler_platform_interface.dart';
......@@ -88,6 +89,10 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform {
@override
Future<bool> shouldShowRequestPermissionRationale(
Permission permission) async {
if (defaultTargetPlatform != TargetPlatform.android) {
return false;
}
final shouldShowRationale = await _methodChannel.invokeMethod(
'shouldShowRequestPermissionRationale', permission.value);
......
......@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin.
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 4.2.0
version: 4.2.1
dependencies:
flutter:
......
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