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

Commit

Permalink
[ios] Update INSTALL doc for -ObjC; use local podspec path
Browse files Browse the repository at this point in the history
- Adds -ObjC flag for static lib.
- Fixes link to iOS SDK site.
- Pushes CocoaPods down the list.
- Changes CocoaPods to use local path, not HTTP.
- Emphasizes that INSTALL.MD is only for custom builds.
  • Loading branch information
friedbunny authored Aug 31, 2016
1 parent c95ffe6 commit dd4d1a9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 45 deletions.
95 changes: 50 additions & 45 deletions platform/ios/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Integrating the Mapbox iOS SDK into your application
# Integrating custom builds of the Mapbox iOS SDK into your application

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).
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).

### Requirements

Expand Down Expand Up @@ -28,51 +28,11 @@ The Mapbox iOS SDK requires Xcode 7.3 or higher.
- a `documentation` folder with HTML API documentation
- an example `Settings.bundle` containing an optional Mapbox Telemetry opt-out setting

### Installation

There are a few ways to install the Mapbox iOS SDK:

#### CocoaPods

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.

1. Zip up the build product.

```bash
cd build/ios/pkg/
ZIP=mapbox-ios-sdk.zip
rm -f ../${ZIP}
zip -r ../${ZIP} *
```

1. Customize [`Mapbox-iOS-SDK.podspec`](../ios/Mapbox-iOS-SDK.podspec) to download this zip file.

```rb
{...}
m.source = {
:http => "http://{...}/mapbox-ios-sdk.zip",
:flatten => true
}
{...}
```

1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`.
```rb
pod 'Mapbox-iOS-SDK', :podspec => 'http://{...}/Mapbox-iOS-SDK.podspec'
```
See the [packaging documentation](DEVELOPING.md#packaging-builds) for other build options.

1. Run `pod update` to grab the newly-built library.
##### Testing pre-releases with CocoaPods
To test pre-releases and/or betas, you can reference the pre-release like so in your Podfile:
### Installation

```rb
pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/ios/Mapbox-iOS-SDK.podspec'
```
There are several ways to install custom builds of the Mapbox iOS SDK:

#### Dynamic framework

Expand Down Expand Up @@ -113,6 +73,51 @@ If your application targets iOS 7.x, you’ll need to install the static framewo
- libsqlite3.tbd
- libz.tbd

1. In the Build Settings tab, find the Other Linker Flags setting and add `-ObjC`.

#### CocoaPods

##### Testing pre-releases with CocoaPods

To test pre-releases and/or betas, you can reference the pre-release like so in your Podfile:

```rb
pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/ios/Mapbox-iOS-SDK.podspec'
```

##### Using your own build with CocoaPods

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.

1. Zip up the build product.

```bash
cd build/ios/pkg/
ZIP=mapbox-ios-sdk.zip
rm -f ../${ZIP}
zip -r ../${ZIP} *
```

1. Customize [`Mapbox-iOS-SDK.podspec`](../ios/Mapbox-iOS-SDK.podspec) to download this zip file.

```rb
{...}
m.source = {
:path => "{...}/mapbox-ios-sdk.zip"
}
{...}
```

1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`.
```rb
pod 'Mapbox-iOS-SDK', :path => '{...}/Mapbox-iOS-SDK.podspec'
```
1. Run `pod update` to grab the newly-built library.
### Configuration
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/).
Expand Down
2 changes: 2 additions & 0 deletions platform/ios/docs/pod-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ If your application targets iOS 7.x, you’ll need to install the static framewo
- libsqlite3.tbd
- libz.tbd

1. In the Build Settings tab, find the Other Linker Flags setting and add `-ObjC`.

{{/STATIC}}

## Configuration
Expand Down

0 comments on commit dd4d1a9

Please sign in to comment.