Mist SDK Best Practices

Mist SDK is an indoor location SDK that provides real-time location coordinates using Mist’s vBLE antenna array Access Point.

How does it work?

  • Mist SDK integrated into the mobile app(iOS or Android) listens to the vBLE beams transmitted from the Mist Access Points.

  • SDK sends the RSSI to the Mist Cloud.

  • Mist Location Engine, based on the RSSI, sends the map and location info to the mobile app.

 

Common Indoor Location use cases

  1. Way-finding: With an accuracy of up to 1-3 meters, real-time way-finding helps your employees, guests, and customers get to where they need to be, with turn-by-turn directions and sub-second latency.

  2. Engagement Analytics: Mist User Engagement service includes base capabilities for analyzing up to 30 days of data, simplifying the process of extracting network insights from data and analytics across your enterprise. You can review weekly schedules of repeat visitors (customer or employee) and then properly align your support resources or introduce enhanced premium services.

  3. App wake up: App wake up is like waking up the app from the killed state when it gets in range of the registered beacon. This is more of app side feature and doesn’t involve SDK. You can, however, start the SDK in the background when you receive the callback in the killed state and use it for analytics purposes.

  4. Proximity-based notification: Proximity notifications and alerts let you greet your patients, clients, or customers as they arrive on site via vBeacons.

 

How to get Mist SDK

Framework and Sample apps on Github

Documentation

Prerequisites

Software:

  1. Xcode or Android Studio IDE.

  2. Access to Mist Account.

  3. Mobile SDK secret.

  4. Location deployed as per Mist guidelines.

Hardware:

  1. Mist Access Point with BLE support.

  2. iPhone/iPad device. Mist SDK cannot be tested on the Xcode/Android Studio simulator.

 

App Permissions

Bluetooth and Location (for backgrounding)

How to Integrate Mist SDK

Enroll a device

  • Use the MobileSDK secret to enroll your device in the Organization using MSTOrgCredentialsManager.

  • Once enrolled, you will receive org_id and secret token from the response required to initialize MSTCentralManager.

  • Enroll the device and save the received secret token in memory.

  • To limit the effects of compromised secret tokens, Mist SDK auto-refreshes the received secret token every 30 days. Please read more in the error handling section below.

 

Cloud Environment

  • The environment is identified based on the first char of the Mobile SDK secret obtained from the Mist Web Portal.

  • If your Org is in environments such as Europe 1, Global 2, Global 3, or Global 4, the Mobile SDK secret will start with ‘E’, ‘G’, ‘M’, or ‘C’ respectively.

  • By default, envType is set to ‘P’ which is ‘Global 1’.

 

Map Information

  • didUpdateDRMap/onMapUpdated gets current map information such as – mapId, name, ppm(pixel per meter), map URL, width, height etc.

  • PPM(pixel per meter) stands for the map scale in the Mist Universe.

 

Way-finding Paths

  • didUpdateDRMap/onMapUpdated Wayfinding paths are received in the maps callback only if they are added in the Mist Web portal.

  • These static paths(nodes, edges) don’t provide turn-by-turn navigation instructions.

 

Location X and Y

  • didUpdateDRRelativeLocation/onDRSnappedLocationUpdated get device current X, Y coordinates on the map in meters.

    • Snapped.X

    • Snapped.Y

 

Direction (heading) and speed

  • didUpdateDRRelativeLocation/onDRSnappedLocationUpdated gets device direction(heading) and speed.

  • Direction(heading) values are from 0-360 degrees.

  • Speed is zero when the device is stationary otherwise > 0.

 

Error handling

  • didErrorOccurWith is the callback for error handling in the SDK. Please see the different types of errors below.

    •  ErrorTypeAuthFailure will return when MSTCentralManager uses an incorrect or expired secret for initialization. This secret will be refreshed after every 30 days. The App Developer must implement the ErrorHandling callback to re-enroll the device once the existing token has expired.

    • ErrorTypeServerOverloaded will return when backoff is triggered due to server overload. SDK will pause for a given amount of time before retrying to connect.

    • ErrorTypeNoBeaconsDetected will return when the device is not in BLE Proximity.

 

No action is required from the Mobile App implementation for “ErrorTypeServerOverloaded”

Client Unique Identifier

  • MistIDGenerator.getMistUUID() is used to get SDK UUID per client to identify the device within the Mist universe uniquely.

 

How to initialize Mist SDK for different use cases

Use case 1(active tracking):

  • If the use case is wayfinding, it is recommended to initialize the MSTCentralManager and start location update – only on the user’s request.

  • Stop location updates once the user has arrived at the destination.

Use case 2 (passive tracking):

  • If the use case is Occupancy Analytics, it is recommended to start initializing the SDK once the Mist beacons are detected and start/stop the location updates(in background and foreground mode) at regular intervals to limit the battery drain.

 

How to test Mist SDK

  1. Test on-site (real Location deployment)

  2. Test on mock site

    • Create a site(which should be solely for testing purposes) in the Org and enable vBLE Engagement

    • Superuser admin can invite the developer/tester with access role “Network Admin” to the site.

    • deploy at least 2 Access Points or BT11 and set up as per Mist location guidelines.

  3. Test remotely (for App development)

    1. Single Test AP(recommended):

      • The developers can request a test AP for development/test purposes. They can set up their test org by following the Mist guidelines.

    2. Beacons/Tags:

      1. Battery beacon/tag(Eddystone UID support) can be used to test SDK on iOS and Android platforms.

      2. The mist support team will require written approval from the Customer’s Mist Account admin(Superuser) so that we can share the beacon configuration details( Eddystone UID -namespace, instance).

    3. Beacon Simulator App:

      1. Beacon Simulator App available on Playstore can be used to test SDK only on iOS Platform.

      2. The mist support team will require written approval from the Customer’s Mist Account admin(Superuser) so that we can share the beacon configuration details( Eddystone UID -namespace, instance).