Cordova is a cross-platform mobile development framework that allows developing mobile applications using JavaScript, HTML and CSS. IndoorAtlas SDK is available through Cordova plugins for iOS and Androidplatforms.
This document covers how to use the IndoorAtlas SDK for Cordova following the example application.
Cordova Plugin
Cordova Plugin is available in the cordova-plugin git repository. Full documentation for this plugin is available in the API documentation page.
Get started with the example project
git clone https://github.com/IndoorAtlas/sdk-cordova-examples cd sdk-cordova-examples/CordovaExamples
The example project contains the following features:
- Start & Stop Positioning
- Display Floor Plan as Google Maps Overlay
Get the necessary credentials
Every application which uses IndoorAtlas service needs unique API key and Secret.
- To obtain these credentials, create a new app at IndoorAtlas Applicationsas described here.
Google Maps API key is also necessary to run the examples:
- You can get Google Maps API key from: https://console.developers.google.com/apis/credentials
Add the necessary credentials in www/js/APIKeys.js
.
Add the desired platform
For iOS development:
cordova platform add https://github.com/apache/cordova-ios.git#4.4.0-ios-sim
For iOS development:
cordova platform add android
If you wish to develop for both Android and iOS you can add both platforms one after the other.
Add Plugins
cordova plugin add cordova-plugin-spinner cordova plugin add https://github.com/IndoorAtlas/cordova-plugin.git
Build the project and run it
cordova build cordova run
If you wish to build or run the application for an specific platform append the word android
or ios
at the end of each of the previous commands.
Note that if you wish to run these examples in an iOS device you have to open Xcode and set up a development team
open platforms/ios/IACordova.xcworkspace