The call to start the Mira SDK should be done as early as possible in your application lifecycle. The most common location will be in your
UIApplicationDelegate instance. By default, the SDK will log interesting beacon events to the console and post a notification named
"MiraEvent" with the log string. You can turn these off by calling
[MiraSDK setLoggingEnabled:NO] or
MiraSDK.setLoggingEnabled(false) as shown below.
You will need to add the following two
UIBackgroundModes to your
location mode is to allow background updates when a user comes within range of a beacon. The
bluetooth-central mode is to allow the SDK to write a small packet of information called a “genotype” to proprietary Mira-controlled beacons found in elevators, taxi cabs, subways, etc. where there is little to no WiFi or cellular connectivity.
In addition, you will need to add the
NSLocationUsageDescription keys to allow your app to receive beacon events in the background. Otherwise, beacon events will only be recorded when your app is active.
You may change the descriptions to better suite your application’s needs.
The SDK targets iOS 7.0+ and is published as a CocoaPod. To use it, simply add the following line to your
Although not required, it is suggested to add the
use_frameworks! tag to your
Podfile when integrating the Mira SDK into a iOS project built with Swift.
You can also view/copy the code in our Github repo. In that case, you will need to link to the following frameworks: