-
-
Notifications
You must be signed in to change notification settings - Fork 858
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
Adds support for when in use only. #1295
Conversation
[_locationManager requestAlwaysAuthorization]; | ||
} else if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"] != nil) { | ||
[_locationManager requestWhenInUseAuthorization]; | ||
} else { | ||
[[NSException exceptionWithName:NSInternalInconsistencyException reason:@"To use location in iOS8 you need to define either NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription in the app bundle's Info.plist file" userInfo:nil] raise]; | ||
errorHandler(@"MISSING_USAGE_DESCRIPTION", @"To use location in iOS8 you need to define at least NSLocationWhenInUseUsageDescription and optionally NSLocationAlwaysAndWhenInUseUsageDescription in the app bundle's Info.plist file"); |
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.
Is this in iOS 8 or from iOS 8?
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.
Good comment, it should be "from" and I have pushed an update.
} else if (permission == PermissionGroupLocationAlways) { | ||
if ([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"] != nil) { | ||
#if PERMISSION_LOCATION |
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.
is this PERMISSION_LOCATION correct?
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.
Yes that is correct. The existing PERMISSION_LOCATION
macro enables "when in use" and "always" permissions. I didn't want to rename it as that would be a breaking change.
Co-authored-by: TimHoogstrate <[email protected]>
Co-authored-by: TimHoogstrate <[email protected]>
…w/flutter-permission-handler into fine_grained_location_permission
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.
LGTM
PERMISSION_LOCATION_WHENINUSE
marco, which can be used instead ofthe
PERMISSION_LOCATION
macro and only enable therequestWhenInUseAuthorization
and remove the
requestAlwaysAuthorization
when requesting location permission.Info.plist
doesn't contain the correct declarations.NSLocationAlwaysAndWhenInUseUsageDescription
property listkey.
Pre-launch Checklist
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.CHANGELOG.md
to add a description of the change.///
).main
.dart format .
and committed any changes.flutter analyze
and fixed any errors.