IndoorAtlas SDK 3.x Migration to GroundSage SDK Guide

IndoorAtlas SDK 3.x is latest IndoorAtlas location services. If your project was previously using IndoorAtlas SDK, it is recommended that you now use GroundSage SDK directly. All apis from IndoorAtlas SDK will be wrapped into GroundSage SDK. Please DO NOT call any apis from IndoorAtlas SDK. This guide will provide you to migrate to GroundSage SDK.

Migration

The following IndoorAtls equivalent function/properties are not available in GroundSage SDK.

distanceFilter
desiredAccuracy
allowsBackgroundLocationUpdates
lockFloor(floor)
unlockFloor()
lockIndoors(lockIndoor)
arSession
releaseArSession()

Location updates

To start updating location and region monitoring, you can do following from IndoorAtlas SDK 3.x.

func startIALocationUpdates() {
    var locationManager = IALocationManager.sharedInstance()
    locationManager.delegate = self
    locationManager.startUpdatingLocation()
}

In order to do the same thing as above, you can do following from GroundSage SDK.

func startLocationUpdates() {
    var mgr = IAGSManager.shared
    mgr.addLocationManagerDelegate(self)
    mgr.startSubscription()
}

Wayfinding

To start wayfinding, you can do following from GroundSage SDK.

func indoorLocationManager(_ manager: IALocationManager, didUpdate route: IARoute) {

}

/**
 * Start wayfinding example
 */
func testWayfinding(_ floor:Int, _ latitude: CLLocationDegrees, _ longitude: CLLocationDegrees) {
    let wayfinding = IAWayfindingRequest()
    wayfinding.floor = floor
    wayfinding.coordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
    let mgr = IAGSManager.shared
    mgr.addLocationManagerDelegate(self)
    mgr.startMonitoring(forWayfinding: wayfinding)
}

/**
 * Stop wayfinding example
 */
func stopWayfindingExample() {
    var mgr = IAGSManager.shared
    mgr.stopMonitoringForWayfinding()
}

Geofence

To add geofences, you can do following from GroundSage SDK.

var geofence: IAGeofence?
func addGeofence(floorLevel: Int) {
    geofence = IAGeofence()
    geofence?.floor = IAFloor(level: floorLevel)
    let mgr = IAGSManager.shared
    mgr.addLocationManagerDelegate(self)
    mgr.startMonitoring(for: geofence!)
}

func stopGeofence() {
    let mgr = IAGSManager.shared
    mgr.stopMonitoring(geofence: geofence!)
}

Heading and attitude filters

To apply heading or attitude filter, you can do following from GroundSage SDK.

func filters() {
    let mgr = IAGSManager.shared
    // Generate new didUpdateHeading event for every 1 degree changes.
    mgr.headingFilter = 1
    // Generate new didUpdateAttitude event for every 1 degree changes.
    mgr.attitudeFilter = 1
}