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

Prompt for access token in iosapp #4728

Merged
merged 2 commits into from
Apr 18, 2016
Merged

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Apr 18, 2016

If no access token is found in user defaults at launch, iosapp prompts the user for an access token. Renamed the user defaults key for the access token to conform to Cocoa naming conventions. The MAPBOX_ACCESS_TOKEN environment variable is still honored.

Added an action to MGLMapView that reloads the current style. Note that it doesn’t clear the cache; it’s pretty much only useful for ensuring that a change in access token is reflected on the map or for forcing the map view to retry loading tiles independently of the exponential back-off strategy.

Fixes #3102 and fixes #4696.

/cc @friedbunny @kkaefer

@1ec5 1ec5 self-assigned this Apr 18, 2016
@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS refactor labels Apr 18, 2016
@1ec5 1ec5 added this to the ios-v3.3.0 milestone Apr 18, 2016
@friedbunny
Copy link
Contributor

As you noted, users will expect a -reloadStyle: method to fetch the current style from the network and display changes. Until we do have such an implementation, can we keep this as a private method or as a category/extension where necessary?

If we make this public now, let’s add a warning to the inline docs stating that it does not affect cached resources.

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 18, 2016

I’d rather that iosapp rely solely on public API, and it does fetch the current style when the original requests failed due to network conditions. So let’s document the caveats.

1ec5 added 2 commits April 18, 2016 14:57
If no access token is found in user defaults at launch, iosapp prompts the user for an access token. Renamed the user defaults key for the access token to conform to Cocoa naming conventions.

Fixes #4696.
@1ec5 1ec5 force-pushed the 1ec5-iosapp-access-token-4696 branch from 44027e0 to 96e0857 Compare April 18, 2016 21:57
@1ec5 1ec5 merged commit 96e0857 into master Apr 18, 2016
@1ec5 1ec5 deleted the 1ec5-iosapp-access-token-4696 branch April 18, 2016 22:13
1ec5 added a commit that referenced this pull request Apr 19, 2016
Prompt for an access token before starting benchmarking.

/ref #4728
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iosapp should prompt for an access token Reloading a failed MGLMapView
2 participants