Commit 2db062fa by Maurits van Beusekom Committed by GitHub

Updates the README for the new location permissions. (#1297)

* Updates the README for the new location permissions

* Update permission_handler/CHANGELOG.md

Co-authored-by: TimHoogstrate <tim566@hotmail.com>

---------

Co-authored-by: TimHoogstrate <tim566@hotmail.com>
parent 74e89c08
## 11.3.1
* Documents the use of the `PERMISSION_LOCAITON_WHENINUSE` macro on iOS.
## 11.3.0 ## 11.3.0
* Adds a new permission `Permission.backgroundRefresh` to check the background refresh permission status via: * Adds a new permission `Permission.backgroundRefresh` to check the background refresh permission status via:
......
...@@ -14,7 +14,7 @@ See the [FAQ](#faq) section for more information on common questions when using ...@@ -14,7 +14,7 @@ See the [FAQ](#faq) section for more information on common questions when using
While the permissions are being requested during runtime, you'll still need to tell the OS which permissions your app might potentially use. That requires adding permission configuration to Android* and iOS-specific files. While the permissions are being requested during runtime, you'll still need to tell the OS which permissions your app might potentially use. That requires adding permission configuration to Android* and iOS-specific files.
<details> <details>
<summary>Android</summary> <summary>Android (click to expand)</summary>
**Upgrade pre-1.12 Android projects** **Upgrade pre-1.12 Android projects**
...@@ -52,7 +52,7 @@ In general, it's sufficient to add permission only to the `main` version. ...@@ -52,7 +52,7 @@ In general, it's sufficient to add permission only to the `main` version.
</details> </details>
<details> <details>
<summary>iOS</summary> <summary>iOS (click to expand)</summary>
Add permission to your `Info.plist` file. Add permission to your `Info.plist` file.
[Here](https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/example/ios/Runner/Info.plist)'s an example `Info.plist` with a complete list of all possible permissions. [Here](https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/example/ios/Runner/Info.plist)'s an example `Info.plist` with a complete list of all possible permissions.
...@@ -68,72 +68,70 @@ You must list the permission you want to use in your application: ...@@ -68,72 +68,70 @@ You must list the permission you want to use in your application:
```ruby ```ruby
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
... # Here are some configurations automatically generated by flutter flutter_additional_ios_build_settings(target)
# Start of the permission_handler configuration
target.build_configurations.each do |config| target.build_configurations.each do |config|
# You can remove unused permissions here
# You can enable the permissions needed here. For example to enable camera # for more information: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
# permission, just remove the `#` character in front so it looks like this: # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
#
# ## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=1'
#
# Preprocessor definitions can be found at: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)', '$(inherited)',
## dart: [PermissionGroup.calendarWriteOnly, PermissionGroup.calendar (iOS 16 and below)] ## dart: PermissionGroup.calendar
# 'PERMISSION_EVENTS=1', 'PERMISSION_EVENTS=1',
## dart: [PermissionGroup.calendarFullAccess, PermissionGroup.calendar (iOS 17 and above)] ## dart: PermissionGroup.calendarFullAccess
# 'PERMISSION_EVENTS_FULL_ACCESS=1', 'PERMISSION_EVENTS_FULL_ACCESS=1',
## dart: PermissionGroup.reminders ## dart: PermissionGroup.reminders
# 'PERMISSION_REMINDERS=1', 'PERMISSION_REMINDERS=1',
## dart: PermissionGroup.contacts ## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=1', 'PERMISSION_CONTACTS=1',
## dart: PermissionGroup.camera ## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=1', 'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone ## dart: PermissionGroup.microphone
# 'PERMISSION_MICROPHONE=1', 'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.speech ## dart: PermissionGroup.speech
# 'PERMISSION_SPEECH_RECOGNIZER=1', 'PERMISSION_SPEECH_RECOGNIZER=1',
## dart: PermissionGroup.photos ## dart: PermissionGroup.photos
# 'PERMISSION_PHOTOS=1', 'PERMISSION_PHOTOS=1',
## dart: PermissionGroup.photosAddOnly
# 'PERMISSION_PHOTOS_ADD_ONLY=1',
## The 'PERMISSION_LOCATION' macro enables the `locationWhenInUse` and `locationAlways` permission. If
## the application only requires `locationWhenInUse`, only specify the `PERMISSION_LOCATION_WHENINUSE`
## macro.
##
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
# 'PERMISSION_LOCATION=1', 'PERMISSION_LOCATION=1',
'PERMISSION_LOCATION_WHENINUSE=0',
## dart: PermissionGroup.notification ## dart: PermissionGroup.notification
# 'PERMISSION_NOTIFICATIONS=1', 'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.mediaLibrary ## dart: PermissionGroup.mediaLibrary
# 'PERMISSION_MEDIA_LIBRARY=1', 'PERMISSION_MEDIA_LIBRARY=1',
## dart: PermissionGroup.sensors ## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=1', 'PERMISSION_SENSORS=1',
## dart: PermissionGroup.bluetooth ## dart: PermissionGroup.bluetooth
# 'PERMISSION_BLUETOOTH=1', 'PERMISSION_BLUETOOTH=1',
## dart: PermissionGroup.appTrackingTransparency ## dart: PermissionGroup.appTrackingTransparency
# 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
## dart: PermissionGroup.criticalAlerts
'PERMISSION_CRITICAL_ALERTS=1',
## dart: PermissionGroup.criticalAlerts ## dart: PermissionGroup.criticalAlerts
# 'PERMISSION_CRITICAL_ALERTS=1' 'PERMISSION_ASSISTANT=1',
] ]
end end
# End of the permission_handler configuration
end end
end end
``` ```
...@@ -150,7 +148,7 @@ You must list the permission you want to use in your application: ...@@ -150,7 +148,7 @@ You must list the permission you want to use in your application:
The following lists the relationship between `Permission` and `The key of Info.plist`: The following lists the relationship between `Permission` and `The key of Info.plist`:
| Permission | Info.plist | Macro | | Permission | Info.plist | Macro |
|-------------------------------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------- | ------------------------------------ | |---------------------------------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| PermissionGroup.calendar (< iOS 17) | NSCalendarsUsageDescription | PERMISSION_EVENTS | | PermissionGroup.calendar (< iOS 17) | NSCalendarsUsageDescription | PERMISSION_EVENTS |
| PermissionGroup.calendarWriteOnly (iOS 17+) | NSCalendarsWriteOnlyAccessUsageDescription | PERMISSION_EVENTS | | PermissionGroup.calendarWriteOnly (iOS 17+) | NSCalendarsWriteOnlyAccessUsageDescription | PERMISSION_EVENTS |
| PermissionGroup.calendarFullAccess (iOS 17+) | NSCalendarsFullAccessUsageDescription | PERMISSION_EVENTS_FULL_ACCESS | | PermissionGroup.calendarFullAccess (iOS 17+) | NSCalendarsFullAccessUsageDescription | PERMISSION_EVENTS_FULL_ACCESS |
...@@ -162,8 +160,10 @@ You must list the permission you want to use in your application: ...@@ -162,8 +160,10 @@ You must list the permission you want to use in your application:
| PermissionGroup.photos | NSPhotoLibraryUsageDescription | PERMISSION_PHOTOS | | PermissionGroup.photos | NSPhotoLibraryUsageDescription | PERMISSION_PHOTOS |
| PermissionGroup.photosAddOnly | NSPhotoLibraryAddUsageDescription | PERMISSION_PHOTOS_ADD_ONLY | | PermissionGroup.photosAddOnly | NSPhotoLibraryAddUsageDescription | PERMISSION_PHOTOS_ADD_ONLY |
| PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse | NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION | | PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse | NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION |
| PermissionGroup.locationWhenInUse | NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION_WHENINUSE |
| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS | | PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS |
| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMedia | PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMedia |
PERMISSION_MEDIA_LIBRARY |
4. Clean & Rebuild 4. Clean & Rebuild
......
...@@ -2,7 +2,7 @@ name: permission_handler ...@@ -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. 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 repository: https://github.com/baseflow/flutter-permission-handler
issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues issue_tracker: https://github.com/Baseflow/flutter-permission-handler/issues
version: 11.3.0 version: 11.3.1
environment: environment:
...@@ -26,7 +26,7 @@ dependencies: ...@@ -26,7 +26,7 @@ dependencies:
sdk: flutter sdk: flutter
meta: ^1.7.0 meta: ^1.7.0
permission_handler_android: ^12.0.3 permission_handler_android: ^12.0.3
permission_handler_apple: ^9.4.0 permission_handler_apple: ^9.4.3
permission_handler_html: ^0.1.1 permission_handler_html: ^0.1.1
permission_handler_windows: ^0.2.1 permission_handler_windows: ^0.2.1
permission_handler_platform_interface: ^4.2.0 permission_handler_platform_interface: ^4.2.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