Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LocationPermission] Fix warning UI unresponsive in mainthread when c… #1329

5 changes: 5 additions & 0 deletions permission_handler/CHANGELOG.md
honghai2196 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 11.3.2

* Update `permission_handler_apple` dependency to version 9.4.5
* Fix Xcode warning: unreponsive in main thread when calling isLocationEnabled.

## 11.3.1

* Documents the use of the `PERMISSION_LOCAITON_WHENINUSE` macro on iOS.
Expand Down
4 changes: 2 additions & 2 deletions permission_handler/pubspec.yaml
honghai2196 marked this conversation as resolved.
Show resolved Hide resolved
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: 11.3.1
version: 11.3.2


environment:
Expand All @@ -26,7 +26,7 @@ dependencies:
sdk: flutter
meta: ^1.7.0
permission_handler_android: ^12.0.3
permission_handler_apple: ^9.4.3
permission_handler_apple: ^9.4.4
permission_handler_html: ^0.1.1
permission_handler_windows: ^0.2.1
permission_handler_platform_interface: ^4.2.0
Expand Down
4 changes: 4 additions & 0 deletions permission_handler_apple/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 9.4.5

* Fixes issue #1002, Xcode warning of the unresponsive of main thread when checking isLocationEnabled.

## 9.4.4

* Fixes potentially-nil return type of EventPermissionStrategy#getEntityType.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ - (PermissionStatus)checkPermissionStatus:(PermissionGroup)permission {
}

- (void)checkServiceStatus:(PermissionGroup)permission completionHandler:(ServiceStatusHandler)completionHandler {
completionHandler([CLLocationManager locationServicesEnabled] ? ServiceStatusEnabled : ServiceStatusDisabled);
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL isEnabled = [CLLocationManager locationServicesEnabled];

dispatch_async(dispatch_get_main_queue(), ^(void) {
completionHandler(isEnabled ? ServiceStatusEnabled : ServiceStatusDisabled);
});
});
}

- (void)requestPermission:(PermissionGroup)permission completionHandler:(PermissionStatusHandler)completionHandler errorHandler:(PermissionErrorHandler)errorHandler {
Expand Down
2 changes: 1 addition & 1 deletion permission_handler_apple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: permission_handler_apple
description: Permission plugin for Flutter. This plugin provides the iOS 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: 9.4.4
version: 9.4.5

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down
Loading