From 8e1b87776022ae8493556f5be688c6a5f4d78b4a Mon Sep 17 00:00:00 2001 From: Alex Melnyk <30177329+alex-melnyk@users.noreply.github.com> Date: Thu, 25 Jan 2024 19:36:08 +0200 Subject: [PATCH] macos example project updated --- permission_handler/example/lib/main.dart | 2 +- permission_handler/example/macos/Podfile | 57 ++++++++++++++++++ permission_handler/pubspec.yaml | 3 +- .../UserInterfaceState.xcuserstate | Bin 16543 -> 16543 bytes 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/permission_handler/example/lib/main.dart b/permission_handler/example/lib/main.dart index b1615f332..bd0b085dc 100644 --- a/permission_handler/example/lib/main.dart +++ b/permission_handler/example/lib/main.dart @@ -37,7 +37,7 @@ class _PermissionHandlerWidgetState extends State { child: ListView( children: Permission.values .where((permission) { - if (Platform.isIOS) { + if (Platform.isIOS || Platform.isMacOS) { return permission != Permission.unknown && permission != Permission.phone && permission != Permission.sms && diff --git a/permission_handler/example/macos/Podfile b/permission_handler/example/macos/Podfile index c795730db..7c34bd943 100644 --- a/permission_handler/example/macos/Podfile +++ b/permission_handler/example/macos/Podfile @@ -39,5 +39,62 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_macos_build_settings(target) + + target.build_configurations.each do |config| + # You can remove unused permissions here + # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h + # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: [PermissionGroup.calendarWriteOnly, PermissionGroup.calendar (until iOS 16)] + 'PERMISSION_EVENTS=1', + + ## dart: [PermissionGroup.calendarFullAccess, PermissionGroup.calendar (from iOS 17)] + 'PERMISSION_EVENTS_FULL_ACCESS=1', + + ## dart: PermissionGroup.reminders + 'PERMISSION_REMINDERS=1', + + ## dart: PermissionGroup.contacts + 'PERMISSION_CONTACTS=1', + + ## dart: PermissionGroup.camera + 'PERMISSION_CAMERA=1', + + ## dart: PermissionGroup.microphone + 'PERMISSION_MICROPHONE=1', + + ## dart: PermissionGroup.speech + 'PERMISSION_SPEECH_RECOGNIZER=1', + + ## dart: PermissionGroup.photos + 'PERMISSION_PHOTOS=1', + + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_LOCATION=1', + + ## dart: PermissionGroup.notification + 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + 'PERMISSION_MEDIA_LIBRARY=1', + + ## dart: PermissionGroup.sensors + 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + 'PERMISSION_CRITICAL_ALERTS=1', + + ## dart: PermissionGroup.assistant + 'PERMISSION_ASSISTANT=1', + ] + end end end diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index 14ec947c3..9e171f5c0 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -27,7 +27,8 @@ dependencies: sdk: flutter meta: ^1.7.0 permission_handler_android: ^12.0.3 - permission_handler_apple: ^9.3.0 + permission_handler_apple: + path: ../permission_handler_apple permission_handler_html: ^0.1.1 permission_handler_windows: ^0.2.1 permission_handler_platform_interface: ^4.1.0 diff --git a/permission_handler_apple/example/macos/Runner.xcworkspace/xcuserdata/melnyk.xcuserdatad/UserInterfaceState.xcuserstate b/permission_handler_apple/example/macos/Runner.xcworkspace/xcuserdata/melnyk.xcuserdatad/UserInterfaceState.xcuserstate index c1b4ba8466313a39bb6237e510369913705197af..59c414fd2b258672090426a23a71948a26c783bb 100644 GIT binary patch delta 83 zcmbQ=$T+`|af1>Y%daoDSvRY(`7i=mj|(@Kv4?OAOl9inY4R;0 kGsYR41%+P=vivRlr?p9ypNDbAWC254Fe$M)&Crq`08=p@ga7~l delta 83 zcmbQ=$T+`|af1>Y%f>S^m^Z7j`7i=m^ISKVv4?Q;crZ?DNNA{7#OTd9bF!eY=;YTz js*E!?3kts$WVwDlJYth7KMznwz|a;xs)5F