IndoorAtlas native plugin for Android. iOS support is currently Work-In-Progress (see: #feature/ios-support branch).
This class provides access to IndoorAtlas location services.
Returns the active IALocationManager
. If none exists, one is initialized and cached for future calls. This follows the singleton pattern, for the sake of simplicity. That and there wasn't a use case involving multiple instances in this module's original requirements.
apiKey
: string - Your IndoorAtlas API keyapiSecret
: string - Your IndoorAtlas API secret
This should be called before any other methods. This method is optional on Android if your key/secret are defined in AndroidManifest.xml (see here for more info.)
event
: string - An event type fromIndoorAtlas.Events
listener
: function - Event listener
Register an event handler listener
to be called every time the specified event
is dispatched.
Event data is passed as an argument to the listener function.
event
: string - An event type fromIndoorAtlas.Events
listener
: function - Event listener
Register an event handler listener
to be called once, will be called and then unregistered the next time the specified event
is dispatched.
Event data is passed as an argument to the listener function.
event
: string - An event type fromIndoorAtlas.Events
listener
: function - Event listener
Unregister the event handler listener
for future invocations of the event
type specified.
Dispatched when the location has changed.
Dispatched when there is a change in the calibration quality.
Dispatched when the location has changed.
Dispatched when the device enters a mapped region.
Dispatched when the device exits a mapped region.
import IndoorAtlas, { IALocationManager } from 'react-native-indoor-atlas';
const API_KEY = '...',
API_SECRET = '...';
let locationManager = null
IALocationManager.getInstance()
.then(lm => locationManager = lm)
.then(() => locationManager.setApiKey(API_KEY, API_SECRET))
.then(() => {
locationManager
.on(IALocationManager.Events.ON_LOCATION_CHANGED, e => {
currentLocation = e.location
})
})