From df24a26f1c9e26ae2d28e5fd218c17bbe91e0bab Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 17:20:17 -0400 Subject: [PATCH 1/9] added iOS imports --- .../ios/Classes/PermissionHandlerEnums.h | 1 + .../ios/Classes/PermissionManager.h | 34 +++++++++---------- .../CriticalAlertsPermissionStrategy.h | 1 + .../strategies/LocationPermissionStrategy.h | 1 + .../NotificationPermissionStrategy.h | 2 ++ .../Classes/strategies/PermissionStrategy.h | 2 +- .../strategies/PhonePermissionStrategy.m | 1 + 7 files changed, 24 insertions(+), 18 deletions(-) diff --git a/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h b/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h index 864a5e3a2..70897c34b 100644 --- a/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h +++ b/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h @@ -4,6 +4,7 @@ // // Created by Razvan Lung on 15/02/2019. // +#import // ios: PermissionGroupCalendar // Info.plist: NSCalendarsUsageDescription diff --git a/permission_handler_apple/ios/Classes/PermissionManager.h b/permission_handler_apple/ios/Classes/PermissionManager.h index 4625f8dd6..dc4660e30 100644 --- a/permission_handler_apple/ios/Classes/PermissionManager.h +++ b/permission_handler_apple/ios/Classes/PermissionManager.h @@ -9,24 +9,24 @@ #import #import -#import "AudioVideoPermissionStrategy.h" -#import "AppTrackingTransparencyPermissionStrategy.h" -#import "BluetoothPermissionStrategy.h" -#import "ContactPermissionStrategy.h" -#import "EventPermissionStrategy.h" -#import "LocationPermissionStrategy.h" -#import "MediaLibraryPermissionStrategy.h" -#import "PermissionStrategy.h" -#import "PhonePermissionStrategy.h" -#import "PhotoPermissionStrategy.h" -#import "SensorPermissionStrategy.h" -#import "SpeechPermissionStrategy.h" -#import "StoragePermissionStrategy.h" -#import "UnknownPermissionStrategy.h" -#import "NotificationPermissionStrategy.h" -#import "CriticalAlertsPermissionStrategy.h" +#import "strategies/AudioVideoPermissionStrategy.h" +#import "strategies/AppTrackingTransparencyPermissionStrategy.h" +#import "strategies/BluetoothPermissionStrategy.h" +#import "strategies/ContactPermissionStrategy.h" +#import "strategies/EventPermissionStrategy.h" +#import "strategies/LocationPermissionStrategy.h" +#import "strategies/MediaLibraryPermissionStrategy.h" +#import "strategies/PermissionStrategy.h" +#import "strategies/PhonePermissionStrategy.h" +#import "strategies/PhotoPermissionStrategy.h" +#import "strategies/SensorPermissionStrategy.h" +#import "strategies/SpeechPermissionStrategy.h" +#import "strategies/StoragePermissionStrategy.h" +#import "strategies/UnknownPermissionStrategy.h" +#import "strategies/NotificationPermissionStrategy.h" +#import "strategies/CriticalAlertsPermissionStrategy.h" #import "PermissionHandlerEnums.h" -#import "Codec.h" +#import "util/Codec.h" typedef void (^PermissionRequestCompletion)(NSDictionary *permissionRequestResults); diff --git a/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h index 44b857f48..627f0dc52 100644 --- a/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h @@ -11,6 +11,7 @@ #if PERMISSION_CRITICAL_ALERTS #import +#import @interface CriticalAlertsPermissionStrategy : NSObject diff --git a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h index 9ca88c012..85ff52d15 100644 --- a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h @@ -9,6 +9,7 @@ #if PERMISSION_LOCATION #import +#import @interface LocationPermissionStrategy : NSObject - (instancetype)initWithLocationManager; diff --git a/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h index df5a795d6..71640a149 100644 --- a/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h @@ -11,6 +11,8 @@ #if PERMISSION_NOTIFICATIONS #import +#import +#import @interface NotificationPermissionStrategy : NSObject diff --git a/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h index 995751cd5..d94cce8c0 100644 --- a/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h @@ -4,7 +4,7 @@ // #import -#import "PermissionHandlerEnums.h" +#import "../PermissionHandlerEnums.h" typedef void (^ServiceStatusHandler)(ServiceStatus serviceStatus); typedef void (^PermissionStatusHandler)(PermissionStatus permissionStatus); diff --git a/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m b/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m index eff71a1f6..32a981de7 100644 --- a/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m +++ b/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m @@ -7,6 +7,7 @@ #import #import +#import #import "PhonePermissionStrategy.h" From 1c1ea0d4d42c2a4091b74c1adba0ebe1fad68b35 Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 17:21:42 -0400 Subject: [PATCH 2/9] added java code style suggestions to PermissionUtils.java --- .../java/com/baseflow/permissionhandler/PermissionUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java index 01c6708cd..ddb2e6ebc 100644 --- a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java +++ b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java @@ -1,6 +1,7 @@ package com.baseflow.permissionhandler; import android.Manifest; +import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.content.pm.PackageInfo; @@ -94,6 +95,7 @@ static int parseManifestName(String permission) { } } + @TargetApi(22) static List getManifestNames(Context context, @PermissionConstants.PermissionGroup int permission) { final ArrayList permissionNames = new ArrayList<>(); @@ -122,6 +124,7 @@ static List getManifestNames(Context context, @PermissionConstants.Permi break; case PermissionConstants.PERMISSION_GROUP_LOCATION_ALWAYS: + // fall through case PermissionConstants.PERMISSION_GROUP_LOCATION_WHEN_IN_USE: case PermissionConstants.PERMISSION_GROUP_LOCATION: // Note that the LOCATION_ALWAYS will deliberately fallthrough to the LOCATION From 321ab3c6313dd0e71e11139f7ef5ac99033929e1 Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 17:23:59 -0400 Subject: [PATCH 3/9] fix PermissionHandlerEnums.h import in Codec.h --- permission_handler_apple/ios/Classes/util/Codec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler_apple/ios/Classes/util/Codec.h b/permission_handler_apple/ios/Classes/util/Codec.h index ad930a490..64394f480 100644 --- a/permission_handler_apple/ios/Classes/util/Codec.h +++ b/permission_handler_apple/ios/Classes/util/Codec.h @@ -4,7 +4,7 @@ // #import -#import "PermissionHandlerEnums.h" +#import "../PermissionHandlerEnums.h" @interface Codec : NSObject + (PermissionGroup)decodePermissionGroupFrom:(NSNumber *_Nonnull)event; From a04b7ab972da6c3e6f91db7736b57ade5b58daa0 Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 17:54:08 -0400 Subject: [PATCH 4/9] Edited pubspec.yaml and CHANGELOG.md files --- permission_handler_apple/CHANGELOG.md | 5 +++++ permission_handler_apple/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/permission_handler_apple/CHANGELOG.md b/permission_handler_apple/CHANGELOG.md index 2aa4517de..c528d83a9 100644 --- a/permission_handler_apple/CHANGELOG.md +++ b/permission_handler_apple/CHANGELOG.md @@ -1,3 +1,8 @@ +## 9.1.5 + +* Adds UIKit, UIApplication and Foundation imports to various files which require them. +* Also changes file import paths to relative paths. + ## 9.1.4 * Adds checking whether Bluetooth service is enabled through `Permission.bluetooth.serviceStatus`. diff --git a/permission_handler_apple/pubspec.yaml b/permission_handler_apple/pubspec.yaml index 9c14d0720..9962ffcee 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.1.4 +version: 9.1.5 environment: sdk: ">=2.15.0 <4.0.0" From b1988b5178fc747300d8b7bae662ba68a2c38934 Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 17:57:03 -0400 Subject: [PATCH 5/9] Edited pubspec.yaml and CHANGELOG.md for android --- permission_handler_android/CHANGELOG.md | 4 ++++ permission_handler_android/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/permission_handler_android/CHANGELOG.md b/permission_handler_android/CHANGELOG.md index 6816d10d2..294fc901f 100644 --- a/permission_handler_android/CHANGELOG.md +++ b/permission_handler_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 10.3.4 + +* Added `TargetApi`` annotation to `getManifestNames` method in `PermissionUtils.java`. + ## 10.3.3 * Migrates the Gradle compile arguments to the example app, so they are not enforced upon consumers of the plugin. diff --git a/permission_handler_android/pubspec.yaml b/permission_handler_android/pubspec.yaml index bb32b6bc3..5a2a720bc 100644 --- a/permission_handler_android/pubspec.yaml +++ b/permission_handler_android/pubspec.yaml @@ -1,7 +1,7 @@ name: permission_handler_android description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions. homepage: https://github.com/baseflow/flutter-permission-handler -version: 10.3.3 +version: 10.3.4 environment: sdk: ">=2.15.0 <4.0.0" From 9b83f705eced75ea05876d904d68940aa107d8e8 Mon Sep 17 00:00:00 2001 From: victorsanni Date: Tue, 8 Aug 2023 18:01:46 -0400 Subject: [PATCH 6/9] fixed formatting error in android CHANGELOG --- permission_handler_android/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permission_handler_android/CHANGELOG.md b/permission_handler_android/CHANGELOG.md index 294fc901f..f0ffe1ae6 100644 --- a/permission_handler_android/CHANGELOG.md +++ b/permission_handler_android/CHANGELOG.md @@ -1,6 +1,6 @@ ## 10.3.4 -* Added `TargetApi`` annotation to `getManifestNames` method in `PermissionUtils.java`. +* Added `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`. ## 10.3.3 From 8d02e28bee563e1b6100a1c9f5c70046932cf96d Mon Sep 17 00:00:00 2001 From: Victor Sanni Date: Wed, 9 Aug 2023 22:06:51 +0000 Subject: [PATCH 7/9] Remove iOS changes --- permission_handler_apple/CHANGELOG.md | 5 --- .../ios/Classes/PermissionHandlerEnums.h | 1 - .../ios/Classes/PermissionManager.h | 34 +++++++++---------- .../CriticalAlertsPermissionStrategy.h | 1 - .../strategies/LocationPermissionStrategy.h | 1 - .../NotificationPermissionStrategy.h | 2 -- .../Classes/strategies/PermissionStrategy.h | 2 +- .../strategies/PhonePermissionStrategy.m | 1 - .../ios/Classes/util/Codec.h | 2 +- permission_handler_apple/pubspec.yaml | 2 +- 10 files changed, 20 insertions(+), 31 deletions(-) diff --git a/permission_handler_apple/CHANGELOG.md b/permission_handler_apple/CHANGELOG.md index c528d83a9..2aa4517de 100644 --- a/permission_handler_apple/CHANGELOG.md +++ b/permission_handler_apple/CHANGELOG.md @@ -1,8 +1,3 @@ -## 9.1.5 - -* Adds UIKit, UIApplication and Foundation imports to various files which require them. -* Also changes file import paths to relative paths. - ## 9.1.4 * Adds checking whether Bluetooth service is enabled through `Permission.bluetooth.serviceStatus`. diff --git a/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h b/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h index 70897c34b..864a5e3a2 100644 --- a/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h +++ b/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h @@ -4,7 +4,6 @@ // // Created by Razvan Lung on 15/02/2019. // -#import // ios: PermissionGroupCalendar // Info.plist: NSCalendarsUsageDescription diff --git a/permission_handler_apple/ios/Classes/PermissionManager.h b/permission_handler_apple/ios/Classes/PermissionManager.h index dc4660e30..4625f8dd6 100644 --- a/permission_handler_apple/ios/Classes/PermissionManager.h +++ b/permission_handler_apple/ios/Classes/PermissionManager.h @@ -9,24 +9,24 @@ #import #import -#import "strategies/AudioVideoPermissionStrategy.h" -#import "strategies/AppTrackingTransparencyPermissionStrategy.h" -#import "strategies/BluetoothPermissionStrategy.h" -#import "strategies/ContactPermissionStrategy.h" -#import "strategies/EventPermissionStrategy.h" -#import "strategies/LocationPermissionStrategy.h" -#import "strategies/MediaLibraryPermissionStrategy.h" -#import "strategies/PermissionStrategy.h" -#import "strategies/PhonePermissionStrategy.h" -#import "strategies/PhotoPermissionStrategy.h" -#import "strategies/SensorPermissionStrategy.h" -#import "strategies/SpeechPermissionStrategy.h" -#import "strategies/StoragePermissionStrategy.h" -#import "strategies/UnknownPermissionStrategy.h" -#import "strategies/NotificationPermissionStrategy.h" -#import "strategies/CriticalAlertsPermissionStrategy.h" +#import "AudioVideoPermissionStrategy.h" +#import "AppTrackingTransparencyPermissionStrategy.h" +#import "BluetoothPermissionStrategy.h" +#import "ContactPermissionStrategy.h" +#import "EventPermissionStrategy.h" +#import "LocationPermissionStrategy.h" +#import "MediaLibraryPermissionStrategy.h" +#import "PermissionStrategy.h" +#import "PhonePermissionStrategy.h" +#import "PhotoPermissionStrategy.h" +#import "SensorPermissionStrategy.h" +#import "SpeechPermissionStrategy.h" +#import "StoragePermissionStrategy.h" +#import "UnknownPermissionStrategy.h" +#import "NotificationPermissionStrategy.h" +#import "CriticalAlertsPermissionStrategy.h" #import "PermissionHandlerEnums.h" -#import "util/Codec.h" +#import "Codec.h" typedef void (^PermissionRequestCompletion)(NSDictionary *permissionRequestResults); diff --git a/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h index 627f0dc52..44b857f48 100644 --- a/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/CriticalAlertsPermissionStrategy.h @@ -11,7 +11,6 @@ #if PERMISSION_CRITICAL_ALERTS #import -#import @interface CriticalAlertsPermissionStrategy : NSObject diff --git a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h index 85ff52d15..9ca88c012 100644 --- a/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/LocationPermissionStrategy.h @@ -9,7 +9,6 @@ #if PERMISSION_LOCATION #import -#import @interface LocationPermissionStrategy : NSObject - (instancetype)initWithLocationManager; diff --git a/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h index 71640a149..df5a795d6 100644 --- a/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/NotificationPermissionStrategy.h @@ -11,8 +11,6 @@ #if PERMISSION_NOTIFICATIONS #import -#import -#import @interface NotificationPermissionStrategy : NSObject diff --git a/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h b/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h index d94cce8c0..995751cd5 100644 --- a/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h +++ b/permission_handler_apple/ios/Classes/strategies/PermissionStrategy.h @@ -4,7 +4,7 @@ // #import -#import "../PermissionHandlerEnums.h" +#import "PermissionHandlerEnums.h" typedef void (^ServiceStatusHandler)(ServiceStatus serviceStatus); typedef void (^PermissionStatusHandler)(PermissionStatus permissionStatus); diff --git a/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m b/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m index 32a981de7..eff71a1f6 100644 --- a/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m +++ b/permission_handler_apple/ios/Classes/strategies/PhonePermissionStrategy.m @@ -7,7 +7,6 @@ #import #import -#import #import "PhonePermissionStrategy.h" diff --git a/permission_handler_apple/ios/Classes/util/Codec.h b/permission_handler_apple/ios/Classes/util/Codec.h index 64394f480..ad930a490 100644 --- a/permission_handler_apple/ios/Classes/util/Codec.h +++ b/permission_handler_apple/ios/Classes/util/Codec.h @@ -4,7 +4,7 @@ // #import -#import "../PermissionHandlerEnums.h" +#import "PermissionHandlerEnums.h" @interface Codec : NSObject + (PermissionGroup)decodePermissionGroupFrom:(NSNumber *_Nonnull)event; diff --git a/permission_handler_apple/pubspec.yaml b/permission_handler_apple/pubspec.yaml index 9962ffcee..9c14d0720 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.1.5 +version: 9.1.4 environment: sdk: ">=2.15.0 <4.0.0" From a71a3d36350fe20120fd55af6b17b00fedf93e51 Mon Sep 17 00:00:00 2001 From: Victor Sanni Date: Wed, 9 Aug 2023 18:20:28 -0400 Subject: [PATCH 8/9] Update CHANGELOG.md --- permission_handler_android/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/permission_handler_android/CHANGELOG.md b/permission_handler_android/CHANGELOG.md index f0ffe1ae6..6caa46258 100644 --- a/permission_handler_android/CHANGELOG.md +++ b/permission_handler_android/CHANGELOG.md @@ -1,6 +1,6 @@ ## 10.3.4 -* Added `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`. +* Adds `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`. ## 10.3.3 @@ -49,4 +49,4 @@ ## 9.0.2 -* Moves Android implementation into its own package. \ No newline at end of file +* Moves Android implementation into its own package. From 8f5d03f8a7a7a43f38d1a2dab7a3dccfdfe2a630 Mon Sep 17 00:00:00 2001 From: Victor Sanni Date: Wed, 9 Aug 2023 18:22:17 -0400 Subject: [PATCH 9/9] Remove fall through comment in PermissionUtils.java --- .../java/com/baseflow/permissionhandler/PermissionUtils.java | 1 - 1 file changed, 1 deletion(-) diff --git a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java index ddb2e6ebc..2da2df352 100644 --- a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java +++ b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java @@ -124,7 +124,6 @@ static List getManifestNames(Context context, @PermissionConstants.Permi break; case PermissionConstants.PERMISSION_GROUP_LOCATION_ALWAYS: - // fall through case PermissionConstants.PERMISSION_GROUP_LOCATION_WHEN_IN_USE: case PermissionConstants.PERMISSION_GROUP_LOCATION: // Note that the LOCATION_ALWAYS will deliberately fallthrough to the LOCATION