iOS SDK setup

Download the SDK with CocoaPods

1. Get CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.

If you don’t already have CocoaPods installed install it by running following commands in the terminal. For details see: CocoaPods getting started.

sudo gem install cocoapods
pod setup

2. Install IndoorAtlas SDK using CocoaPods

  1. If you don’t have an Xcode project yet, create one.
  2. Create a file called Podfile in your project directory.
  3. Edit the Podfile and add your dependencies. Here is a simple example:
use_frameworks!
target 'project-target-name' do
	pod 'IndoorAtlas'
end
  1. Make sure you are using use_frameworks! in your Podfile.
  2. Save the Podfile.
  3. Open a terminal and go to the directory containing Podfile.
cd <path-to-project>
  1. Install the pod and any additional dependencies you might have with the command:
pod install
  1. Close Xcode and from now on use your project’s .xcworkspace file to open the project:
open <your-project>.xcworkspace
  1. To access the classes of the framework, include an @import statements at the top of any relevant source files:
@import IndoorAtlas;

Older versions of the SDK

All non-beta releases are available in the CocoaPods trunk repository. If you want to use an older SDK version or an alpha/beta build, they can be used in CocoaPods by defining the IndoorAtlas repository.

Example Podfile for using SDK version 2.5.1:

target 'project-target-name' do
  source 'https://github.com/IndoorAtlas/CocoaPods-Specs.git'
  source 'https://github.com/CocoaPods/Specs.git'
  pod 'IndoorAtlas', '~> 2.5.1'
end

Enabling beacon support

SDK 2.3 and later supports beacons as part of the positioning. Beacons can shorten time to first fix and add robustness in areas that have challenging radio environment. Beacons are not required for the positioning to work, but enabling this feature is recommended for optimal performance. Note that the venue needs to be mapped with MapCreator 2.

If bluetooth is turned off, an alert “Turn On Bluetooth to Allow to Connect to accessories.” will be shown. It is possible to suppress this alert by setting the following app plist key:

<key>IANoCoreBluetoothPowerAlert</key>
<string>AnyString</string>

If you suppress the pop up, remember to instruct users to turn on Bluetooth for better positioning performance.

Disabling Bitcode

IndoorAtlas.framework uses processor optimized assembly functions, so it is not possible to enable Bitcode. Go to Build Settings in your project and under Build Options set Enable Bitcode to No.

Authorization

Every application which uses IndoorAtlas’ service needs unique ApiKey and Secret strings, which you can manage with IndoorAtlas Applications. Further information on API keys can be found here.

Use the IALocationManager ’s setApiKey:andSecret method to set credentials.

static NSString *kAPIKey = @"api-key-here";
static NSString *kAPISecret = @"api-secret-here";
// ...

// Set IndoorAtlas ApiKey and Secret
[locationManager setApiKey:kAPIKey andSecret:kAPISecret];