-
-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #1403 - On iOS, bypass 'always' permission by default #1404
Changes from 3 commits
c933009
9d5ea0d
4e5b972
10923a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -76,16 +76,19 @@ Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permis | |||||
<details> | ||||||
<summary>iOS</summary> | ||||||
|
||||||
On iOS you'll need to add the following entries to your Info.plist file (located under ios/Runner) in order to access the device's location. Simply open your Info.plist file and add the following (make sure you update the description so it is meaningfull in the context of your App): | ||||||
On iOS you'll need to add the following entry to your Info.plist file (located under ios/Runner) in order to access the device's location. Simply open your Info.plist file and add the following (make sure you update the description so it is meaningfull in the context of your App): | ||||||
|
||||||
``` xml | ||||||
<key>NSLocationWhenInUseUsageDescription</key> | ||||||
<string>This app needs access to location when open.</string> | ||||||
<key>NSLocationAlwaysUsageDescription</key> | ||||||
<string>This app needs access to location when in the background.</string> | ||||||
``` | ||||||
|
||||||
If you would like to receive updates when your App is in the background, you'll also need to add the Background Modes capability to your XCode project (Project > Signing and Capabilities > "+ Capability" button) and select Location Updates. Be careful with this, you will need to explain in detail to Apple why your App needs this when submitting your App to the AppStore. If Apple isn't satisfied with the explanation your App will be rejected. | ||||||
If you don't need to receive updates when your app is in the background, then add a compiler flag as follows: in XCode, click on Pods, choose the Target 'geolocator_apple', choose Build Settings, in the search box look for 'Preprocessor Macros' then add the 'BYPASS_PERMISSION_LOCATION_ALWAYS=1' flag (without the quotes). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The markdown in the README supports displaying formatted code by wrapping a certain section with backticks. In this case we can use it around the "'BYPASS_PERMISSION_LOCATION_ALWAYS=1'" keywords, which will render it as code. That means it will also not be necessary to inform developers to leave out the quotes (since the backticks are not rendered):
Suggested change
|
||||||
Setting this flag prevents your app from requiring the `NSLocationAlwaysAndWhenInUseUsageDescription` entry in Info.plist, and avoids questions from Apple when submitting your app. | ||||||
|
||||||
If you do want to receive updates when your App is in the background (or if you don't bypass the permission request as described above) then you'll need to: | ||||||
* Add the Background Modes capability to your XCode project (Project > Signing and Capabilities > "+ Capability" button) and select Location Updates. Be careful with this, you will need to explain in detail to Apple why your App needs this when submitting your App to the AppStore. If Apple isn't satisfied with the explanation your App will be rejected. | ||||||
* Add an `NSLocationAlwaysAndWhenInUseUsageDescription` entry to your Info.plist (use `NSLocationAlwaysUsageDescription` if you're targeting iOS <11.0) | ||||||
|
||||||
When using the `requestTemporaryFullAccuracy({purposeKey: "YourPurposeKey"})` method, a dictionary should be added to the Info.plist file. | ||||||
```xml | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be moved to the
CHANGELOG.md
file of thegeolocator_apple
package. Since the geolocator is setup according to the federated plugin architecture, each platform has it's own package that is published to pub.dev (although the platform specific packages are marked unlisted, they are still published). This means we have to keep track changes for each package in each of theCHANGELOG.md
files.Instead it would be nice if this could say something a long the lines of: