-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
RE: @incanus in #1930 (comment)
Went with two seconds at the end of |
I think this is fine. However if we save & restore |
The user might want to see the user dot without following it. |
My point is that restoring tracking mode at launch will have the same affect as restoring showing the user dot — still prompt the user without delay when restoring state. |
If the saved user tracking mode was The delayed |
This commit breaks master for me. Xcode says "Use of undeclared identifier 'settings' here https://github.com/mapbox/mapbox-gl-native/pull/2265/files#diff-33b34b5f099a16158c8462652a0c3688R79 |
This was broken subsequently in 0a172a2#diff-33b34b5f099a16158c8462652a0c3688 when we moved directly to using |
I think you may want to prefix your defaults or use |
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Sandboxing means that we only have to contend with certain Apple |
Previously in #2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. #2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke #2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Previously in mapbox#2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. mapbox#2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke mapbox#2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
Previously in mapbox#2265 we would ask for location permission at app startup if `!settings->showsUserLocation`. mapbox#2193 0a172a2 changed the way we used `NSUserDefaults` and mostly removed the `settings` object, which broke mapbox#2265. Rather than fix our pestering location permissions ask at startup, this commit now only asks for location permissions when the user hits the locate-me button. Once a user grants permission, the user dot appears because a `userTrackingMode` is set, `showsUserLocation` is permanently set to `YES` in `NSUserDefaults` and is restored at launch.
The iosapp demo app was asking for location permission via
showsUserLocation = YES
inviewDidLoad
, then immediately havingrestoreState:
setshowsUserLocation = NO
because that's what the default is.This PR lets
restoreState:
do the setting ofshowsUserLocation
and then only asks for permissions if the value isNO
— after a delay to allow the map to load.Fixes #1930.
/cc @1ec5 @incanus