Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

iOS demo app: Prompt users to open Settings.app if location access previously denied - #1075

Closed
friedbunny wants to merge 1 commit into
mapbox:masterfrom
friedbunny:location-settings-prompt
Closed

friedbunny wants to merge 1 commit into
mapbox:masterfrom
friedbunny:location-settings-prompt

Conversation

@friedbunny

Copy link
Copy Markdown
Contributor

With iOS 8 it became possible to redirect users to an app's panel in Settings.app, so let's do that if the user hits the locate button but has previously denied access. Clearly this isn't terribly important, but I see this as an example of a best practice that we can pass along to developers.

This also happens to use UIAlertController — another iOS 8 addition — largely because I didn't want to bother with a UIAlertView delegate.

ios-simulator-screen-shot-mar-23 -2015 -4 39 08-pm

iOS 7 and lower will continue to show the old alert. (Tested in simulator.)

The one downside to this is that there's no direct way to return from Settings.app to the demo app. Maybe iOS 9...

@incanus

incanus commented Mar 23, 2015

Copy link
Copy Markdown
Contributor

Yeah, low priority, but thanks. My outlook is to try to keep the demo app doing as little as possible to flex the map view as a dev and testing framework. But passing along a best practice could be nice.

@incanus incanus added the iOS Mapbox Maps SDK for iOS label Mar 23, 2015
@friedbunny

Copy link
Copy Markdown
Contributor Author

Something to consider for future, more kitchen-sinky demo apps. 💡

@friedbunny

Copy link
Copy Markdown
Contributor Author

This particular implementation will be obsoleted by e9993b7 and the move of the basic location authorization ask to [MGLMapView setShowsUserLocation:].

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants