diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-11 12:21:49 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-12 14:53:52 -0800 |
commit | 13e2acbc754893efb945fe02d20824698415dcdb (patch) | |
tree | e8e4c966f03798fc6896a0fd3163e83921f84a38 /platform/osx/include/MGLAccountManager.h | |
parent | ab677a7905b0f81850d6aa3dcdd2caebc0dbc851 (diff) | |
download | qtlocation-mapboxgl-13e2acbc754893efb945fe02d20824698415dcdb.tar.gz |
[ios, osx] Consolidate remaining files in platform/{ios,osx}
Diffstat (limited to 'platform/osx/include/MGLAccountManager.h')
-rw-r--r-- | platform/osx/include/MGLAccountManager.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/platform/osx/include/MGLAccountManager.h b/platform/osx/include/MGLAccountManager.h new file mode 100644 index 0000000000..efcec5419c --- /dev/null +++ b/platform/osx/include/MGLAccountManager.h @@ -0,0 +1,44 @@ +#import <Foundation/Foundation.h> + +#import "MGLTypes.h" + +NS_ASSUME_NONNULL_BEGIN + +/** The MGLAccountManager object provides a global way to set a Mapbox API + access token, as well as other settings used framework-wide. */ +@interface MGLAccountManager : NSObject + +#pragma mark Authorizing access +/** @name Authorizing Access */ + +/** Set the + [Mapbox access token](https://www.mapbox.com/help/define-access-token/) to + used by all instances of MGLMapView in the current application. + + Mapbox-hosted vector tiles and styles require an API access token, which you + can obtain from the + [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). Access + tokens associate requests to Mapbox’s vector tile and style APIs with your + Mapbox account. They also deter other developers from using your styles + without your permission. + + @param accessToken A Mapbox access token. Calling this method with a value + of `nil` has no effect. + + @note You must set the access token before attempting to load any + Mapbox-hosted style. Therefore, you should generally set it before + creating an instance of MGLMapView. The recommended way to set an access + token is to add an entry to your application’s Info.plist file with the + key `MGLMapboxAccessToken` and the type String. Alternatively, you may + call this method from your application delegate’s + -applicationDidFinishLaunching: method. */ ++ (void)setAccessToken:(nullable NSString *)accessToken; + +/** Returns the + [Mapbox access token](https://www.mapbox.com/help/define-access-token/) in + use by instances of MGLMapView in the current application. */ ++ (nullable NSString *)accessToken; + +@end + +NS_ASSUME_NONNULL_END |