Cordova/Phonegap Plugin for indoo.rs
see http://indoo.rs/instructions/ how to add indoo.rs SDK to your application.
-
In the Cordova Android application you will need to put the following in your
res/xml/config.xml
file as a child to the widget tag:
<feature name="indoors">
<param name="android-package" value="com.phonegap.plugins.indoors" />
</feature>
-
copy
indoors.java
fromAndroid/src/com/phonegap/plugins
folder to your Cordova Android application intosrc/com/phonegap/plugins
. You may have to create that directory path in your project. -
copy the
www/indoors.js
file into your application'sassets/www
folder. -
include
indoors.js
into your index.html
<script type="text/javascript" charset="utf-8" src="indoors.js"></script>
- see Example Usage how to use Plugin
-
Locate the plugins section of your Project Navigator and create a group "indoors". Make sure it is added as a "group" (yellow folder)
-
copy
CDVindoo.rs.h
andCDVindoo.rs.m
from the iOS folder into the new group "indoors". -
Find the
config.xml
file in the project navigator and add a new entry as a child to thewidget
tag:
<feature name="indoors">
<param name="ios-package" value="CDVindoors" />
</feature>
-
copy the
www/indoors.js
file into the www directory in Xcode. -
include
indoors.js
into your index.html
<script type="text/javascript" charset="utf-8" src="indoors.js"></script>
- see Example Usage how to use Plugin
IndoorNav.init('APIKEY', 'BUILDINGID');
$(window).unload(function() {
IndoorNav.destruct();
});
IndoorNav = {
init: function(apikey, building) {
IndoorNav.indoors = new indoors(apikey, building);
IndoorNav.indoors.onmessage = function(e) {
console.log('MESSAGE: ' + e.data.indoorsEvent + ' | DATA: ' + e.data.indoorsData) ; //TODO
};
IndoorNav.indoors.onsuccess = function(e) {
console.log('SUCCESS: ' + e.data.indoorsEvent + ' | DATA: ' + e.data.indoorsData); //TODO
};
IndoorNav.indoors.onerror = function(e) {
console.log('ERROR: ' + e.data.indoorsEvent + ' | DATA: ' + e.data.indoorsData) ; //TODO
};
},
destruct: function() {
if(typeof IndoorNav.indoors != 'undefined') {
IndoorNav.indoors.destruct();
}
}
};