Skip to content

Commit

Permalink
macos example project updated
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-melnyk committed Jan 25, 2024
1 parent e75f629 commit 8e1b877
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion permission_handler/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _PermissionHandlerWidgetState extends State<PermissionHandlerWidget> {
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 &&
Expand Down
57 changes: 57 additions & 0 deletions permission_handler/example/macos/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion permission_handler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.

0 comments on commit 8e1b877

Please sign in to comment.