From 5e97c6ed0eb3224bb10e7ab0f3d515c64dade86b Mon Sep 17 00:00:00 2001 From: honghai2196 Date: Thu, 30 May 2024 16:23:21 +0700 Subject: [PATCH 1/9] [LocationPermission] Fix warning UI unresponsive in mainthread when calling locationServicesEnabled --- .../ios/Classes/strategies/LocationPermissionStrategy.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.m b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.m index 7e5b0b689..a4f6b21f4 100644 --- a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.m +++ b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.m @@ -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 { From 4d551a4f254d8c0a6f97e8ace3643fbd46129e6b Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:03:58 +0700 Subject: [PATCH 2/9] fix issue #1002: bump version, fix Xcode location check warning --- permission_handler_apple/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler_apple/pubspec.yaml b/permission_handler_apple/pubspec.yaml index ae32542a0..ef6679c56 100644 --- a/permission_handler_apple/pubspec.yaml +++ b/permission_handler_apple/pubspec.yaml @@ -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" From f851dbbf4bc0ebedac20e038be0bf385309f9a4e Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:05:50 +0700 Subject: [PATCH 3/9] fix issue #1002: Xcode warning of the unresponsive of main thread when checking location state --- permission_handler_apple/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/permission_handler_apple/CHANGELOG.md b/permission_handler_apple/CHANGELOG.md index 495783a7e..05dd219d7 100644 --- a/permission_handler_apple/CHANGELOG.md +++ b/permission_handler_apple/CHANGELOG.md @@ -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. From df5b1ed54e87113866e54a6e21dab62b16cfa2a1 Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:07:32 +0700 Subject: [PATCH 4/9] bump version to 11.3.2 --- permission_handler/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index e74fa4bf9..017c59807 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -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: From 206a12771578f8b3a8eed8921381bc71fa2fb3b0 Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:09:56 +0700 Subject: [PATCH 5/9] bump version to 11.3.2: update changelog and fix #1002 --- permission_handler/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/permission_handler/CHANGELOG.md b/permission_handler/CHANGELOG.md index 65b8ef989..f0a7aa062 100644 --- a/permission_handler/CHANGELOG.md +++ b/permission_handler/CHANGELOG.md @@ -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. From b9fc0b6d5478699c6d60d5b24d280c1490934142 Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:11:03 +0700 Subject: [PATCH 6/9] update permission_handler_apple dependency to minimum 9.4.5 --- permission_handler/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index 017c59807..e47cef4a7 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -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.5 permission_handler_html: ^0.1.1 permission_handler_windows: ^0.2.1 permission_handler_platform_interface: ^4.2.0 From 6b3f0d1bf632456bc209e1a5024dc6744ca4739a Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 17:21:10 +0700 Subject: [PATCH 7/9] revert permission_handler_apple dependency --- permission_handler/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index e47cef4a7..189765272 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: sdk: flutter meta: ^1.7.0 permission_handler_android: ^12.0.3 - permission_handler_apple: ^9.4.5 + 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 From 498d1d18d45987b23eaf4dd6d8e3acacdc8ef778 Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 21:41:08 +0700 Subject: [PATCH 8/9] revert CHANGELOG.md --- permission_handler/CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/permission_handler/CHANGELOG.md b/permission_handler/CHANGELOG.md index f0a7aa062..65b8ef989 100644 --- a/permission_handler/CHANGELOG.md +++ b/permission_handler/CHANGELOG.md @@ -1,8 +1,3 @@ -## 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. From c67ae19dddc1081fe03b5b4fb03af922dab41b4b Mon Sep 17 00:00:00 2001 From: honghai2196 <24835894+honghai2196@users.noreply.github.com> Date: Fri, 31 May 2024 21:41:41 +0700 Subject: [PATCH 9/9] revert pubspec.yaml --- permission_handler/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index 189765272..e74fa4bf9 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -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.2 +version: 11.3.1 environment: @@ -26,7 +26,7 @@ dependencies: sdk: flutter meta: ^1.7.0 permission_handler_android: ^12.0.3 - permission_handler_apple: ^9.4.4 + permission_handler_apple: ^9.4.3 permission_handler_html: ^0.1.1 permission_handler_windows: ^0.2.1 permission_handler_platform_interface: ^4.2.0