Commit daf38b13 by honghai2196 Committed by GitHub

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

* [LocationPermission] Fix warning UI unresponsive in mainthread when calling locationServicesEnabled

* fix issue #1002: bump version, fix Xcode location check warning

* fix issue #1002: Xcode warning of the unresponsive of main thread when checking location state

* bump version to 11.3.2

* bump version to 11.3.2: update changelog and fix #1002

* update permission_handler_apple dependency to minimum 9.4.5

* revert permission_handler_apple dependency

* revert CHANGELOG.md

* revert pubspec.yaml
parent 724e3271
## 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.
......
......@@ -36,7 +36,13 @@ NSString *const UserDefaultPermissionRequestedKey = @"org.baseflow.permission_ha
}
- (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 {
......
......@@ -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"
......
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