Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Don't check in access token #58

Merged
merged 3 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ Examples.xcodeproj/project.xcworkspace/
.DS_Store
xcuserdata/
DerivedData/

# Ignore the api key plist, to keep your Mapbox token out of public repos
APIKeys.plist
4 changes: 4 additions & 0 deletions Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
961962D51C583FDC002D3DAB /* ExamplesContainerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 961962D41C583FDC002D3DAB /* ExamplesContainerViewController.m */; };
962B450F1D1C8520007B7454 /* AnnotationViewExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 962B450E1D1C8520007B7454 /* AnnotationViewExample.m */; };
964CB5111E42A0A3004549EA /* AnnotationViewMultipleExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 964CB5101E42A0A3004549EA /* AnnotationViewMultipleExample.swift */; };
964CB5151E43F486004549EA /* APIKeys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 964CB5141E43F486004549EA /* APIKeys.plist */; };
9678E3EE1CEF58DA00F21AE2 /* CustomAnnotationModelExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 9678E3ED1CEF58DA00F21AE2 /* CustomAnnotationModelExample.m */; };
968247031C5BDCBB00494AB8 /* CustomRasterStyleExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 968247021C5BDCBB00494AB8 /* CustomRasterStyleExample.m */; };
968247081C5BEBDC00494AB8 /* SatelliteStyleExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 968247071C5BEBDC00494AB8 /* SatelliteStyleExample.m */; };
Expand Down Expand Up @@ -244,6 +245,7 @@
962B450D1D1C8520007B7454 /* AnnotationViewExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnotationViewExample.h; sourceTree = "<group>"; };
962B450E1D1C8520007B7454 /* AnnotationViewExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnotationViewExample.m; sourceTree = "<group>"; };
964CB5101E42A0A3004549EA /* AnnotationViewMultipleExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnnotationViewMultipleExample.swift; sourceTree = "<group>"; };
964CB5141E43F486004549EA /* APIKeys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = APIKeys.plist; sourceTree = "<group>"; };
9678E3EC1CEF58DA00F21AE2 /* CustomAnnotationModelExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomAnnotationModelExample.h; sourceTree = "<group>"; };
9678E3ED1CEF58DA00F21AE2 /* CustomAnnotationModelExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomAnnotationModelExample.m; sourceTree = "<group>"; };
9678E3F21CEF616700F21AE2 /* CustomAnnotationModels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomAnnotationModels.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -441,6 +443,7 @@
9619628F1C581700002D3DAB /* Supporting Files */ = {
isa = PBXGroup;
children = (
964CB5141E43F486004549EA /* APIKeys.plist */,
9691AAAA1C5AB546006A58C6 /* Examples-Bridging-Header.h */,
961962901C581700002D3DAB /* main.m */,
);
Expand Down Expand Up @@ -659,6 +662,7 @@
9619629C1C581700002D3DAB /* Assets.xcassets in Resources */,
9682471D1C5C123B00494AB8 /* example.geojson in Resources */,
64BBDAF01DF22D9600BB705D /* third_party_vector_style.json in Resources */,
964CB5151E43F486004549EA /* APIKeys.plist in Resources */,
961962CF1C581FBC002D3DAB /* Main.storyboard in Resources */,
96D432061C84B9CF007D09D1 /* pisavector.xcassets in Resources */,
);
Expand Down
7 changes: 7 additions & 0 deletions Examples/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "AppDelegate.h"
@import Mapbox;

@interface AppDelegate ()

Expand All @@ -19,6 +20,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.layer.speed = 100;
}

// Read APIKeys.plist; see APIKeys.EXAMPLE.plist for the format.
NSDictionary *apiKeys = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"APIKeys" ofType:@"plist"]];
NSString *mapboxAccessToken = [apiKeys objectForKey:@"MGLMapboxAccessToken"];
NSAssert(mapboxAccessToken, @"REQUIRED: Mapbox access token must be set in APIKeys.plist");
[MGLAccountManager setAccessToken:mapboxAccessToken];

return YES;
}

Expand Down
6 changes: 1 addition & 5 deletions Examples/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MGLMapboxAccessToken</key>
<string>pk.eyJ1IjoiZnJpZWRidW5ueSIsImEiOiJjaWp2d2lmemQwY3AydmhtMzA4MzJzaWc1In0.dZouZEYwUTwx3jXbh1N_Kw</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Aren&apos;t you a bot, anyway?</string>
<key>NSLocationAlwaysUsageDescription - 2</key>
<string>🚷</string>
<string>🥑🍋🍉</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Eventually this will be used to dynamically generate the example code found on t

## Use
1. Run `install.sh` to download `Mapbox.framework`.
1. `cp Examples/APIKeys.EXAMPLE.plist Examples/APIKeys.plist`
1. Add your Mapbox access token to APIKeys.plist.
1. Open `Examples.xcodeproj`.
1. Follow the instructions in `Example.h` to add new examples.
1. ⚗🔬