Skip to content

Commit

Permalink
Fix build, only ask for location permission on user's instigation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
friedbunny authored and incanus committed Sep 11, 2015
1 parent 0c7ac23 commit 31df5e9
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ios/app/MBXViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ - (void)viewDidLoad
action:@selector(locateUser)];

[self restoreState:nil];

if ( ! settings->showsUserLocation)
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
self.mapView.showsUserLocation = YES;
});
}
}

- (void)saveState:(__unused NSNotification *)notification
Expand Down

0 comments on commit 31df5e9

Please sign in to comment.