|
1 |
| -# Integrating the Mapbox iOS SDK into your application |
| 1 | +# Integrating custom builds of the Mapbox iOS SDK into your application |
2 | 2 |
|
3 |
| -This document explains how to build a development version of Mapbox iOS SDK for use in your own Cocoa Touch application. To use a production-ready version of the SDK, see the [Mapbox iOS SDK homepage](https://github.com/mapbox/ios-sdk). |
| 3 | +This document explains how to build a development version of Mapbox iOS SDK for use in your own Cocoa Touch application. To use a production-ready version of the SDK, see the [Mapbox iOS SDK homepage](https://mapbox.com/ios-sdk). |
4 | 4 |
|
5 | 5 | ### Requirements
|
6 | 6 |
|
@@ -28,51 +28,11 @@ The Mapbox iOS SDK requires Xcode 7.3 or higher.
|
28 | 28 | - a `documentation` folder with HTML API documentation
|
29 | 29 | - an example `Settings.bundle` containing an optional Mapbox Telemetry opt-out setting
|
30 | 30 |
|
31 |
| -### Installation |
32 |
| - |
33 |
| -There are a few ways to install the Mapbox iOS SDK: |
34 |
| - |
35 |
| -#### CocoaPods |
36 |
| - |
37 |
| -Currently, until [#1437](https://github.com/mapbox/mapbox-gl-native/issues/1437) is completed, to install a _development version_ of Mapbox GL using CocoaPods you will need to build it from source manually per above. |
38 |
| - |
39 |
| -1. Zip up the build product. |
40 |
| - |
41 |
| - ```bash |
42 |
| - cd build/ios/pkg/ |
43 |
| - ZIP=mapbox-ios-sdk.zip |
44 |
| - rm -f ../${ZIP} |
45 |
| - zip -r ../${ZIP} * |
46 |
| - ``` |
47 |
| - |
48 |
| -1. Customize [`Mapbox-iOS-SDK.podspec`](../ios/Mapbox-iOS-SDK.podspec) to download this zip file. |
49 |
| - |
50 |
| - ```rb |
51 |
| - {...} |
52 |
| -
|
53 |
| - m.source = { |
54 |
| - :http => "http://{...}/mapbox-ios-sdk.zip", |
55 |
| - :flatten => true |
56 |
| - } |
57 |
| -
|
58 |
| - {...} |
59 |
| - ``` |
60 |
| - |
61 |
| -1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`. |
62 |
| -
|
63 |
| - ```rb |
64 |
| - pod 'Mapbox-iOS-SDK', :podspec => 'http://{...}/Mapbox-iOS-SDK.podspec' |
65 |
| - ``` |
| 31 | +See the [packaging documentation](DEVELOPING.md#packaging-builds) for other build options. |
66 | 32 |
|
67 |
| -1. Run `pod update` to grab the newly-built library. |
68 |
| -
|
69 |
| -##### Testing pre-releases with CocoaPods |
70 |
| -
|
71 |
| -To test pre-releases and/or betas, you can reference the pre-release like so in your Podfile: |
| 33 | +### Installation |
72 | 34 |
|
73 |
| -```rb |
74 |
| -pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/ios/Mapbox-iOS-SDK.podspec' |
75 |
| -``` |
| 35 | +There are several ways to install custom builds of the Mapbox iOS SDK: |
76 | 36 |
|
77 | 37 | #### Dynamic framework
|
78 | 38 |
|
@@ -113,6 +73,51 @@ If your application targets iOS 7.x, you’ll need to install the static framewo
|
113 | 73 | - libsqlite3.tbd
|
114 | 74 | - libz.tbd
|
115 | 75 |
|
| 76 | +1. In the Build Settings tab, find the Other Linker Flags setting and add `-ObjC`. |
| 77 | + |
| 78 | +#### CocoaPods |
| 79 | + |
| 80 | +##### Testing pre-releases with CocoaPods |
| 81 | + |
| 82 | +To test pre-releases and/or betas, you can reference the pre-release like so in your Podfile: |
| 83 | + |
| 84 | +```rb |
| 85 | +pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/ios/Mapbox-iOS-SDK.podspec' |
| 86 | +``` |
| 87 | + |
| 88 | +##### Using your own build with CocoaPods |
| 89 | + |
| 90 | +To install a _development version_ of this SDK using CocoaPods you will need to build it from source manually per above, then include that build product in your Podfile. |
| 91 | + |
| 92 | +1. Zip up the build product. |
| 93 | + |
| 94 | + ```bash |
| 95 | + cd build/ios/pkg/ |
| 96 | + ZIP=mapbox-ios-sdk.zip |
| 97 | + rm -f ../${ZIP} |
| 98 | + zip -r ../${ZIP} * |
| 99 | + ``` |
| 100 | + |
| 101 | +1. Customize [`Mapbox-iOS-SDK.podspec`](../ios/Mapbox-iOS-SDK.podspec) to download this zip file. |
| 102 | + |
| 103 | + ```rb |
| 104 | + {...} |
| 105 | +
|
| 106 | + m.source = { |
| 107 | + :path => "{...}/mapbox-ios-sdk.zip" |
| 108 | + } |
| 109 | +
|
| 110 | + {...} |
| 111 | + ``` |
| 112 | + |
| 113 | +1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`. |
| 114 | +
|
| 115 | + ```rb |
| 116 | + pod 'Mapbox-iOS-SDK', :path => '{...}/Mapbox-iOS-SDK.podspec' |
| 117 | + ``` |
| 118 | +
|
| 119 | +1. Run `pod update` to grab the newly-built library. |
| 120 | +
|
116 | 121 | ### Configuration
|
117 | 122 |
|
118 | 123 | 1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom iOS Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/).
|
|
0 commit comments