Skip to content

Enabling the SDK

Jonathan Arbogast edited this page Mar 23, 2015 · 1 revision

By default, the SDK is disabled and will not scan for nearby Jots. You can check to see if the SDK is enabled or disabled at any time by using the enabled property on the JotStylusManager.

BOOL enabled = [[JotStylusManager sharedInstance] enabled];

Enabling the SDK is the first step to getting connected to Jots. To enable the SDK, simply add the following line.

[[JotStylusManager sharedInstance] enable];

To disable the SDK simply call

[[JotStylusManager sharedInstance] disable];

By default, the SDK will display a UIAlertView if the user tries to connect to a Jot, but Bluetooth is turned off on their device.

Bluetooth Off Alert

If you wish to present your own UI in this situation, you need to tell the SDK about this when you enable it. Simply use this alternative enable method.

[[JotStylusManager sharedInstance] enableWithBluetoothPowerOnAlert:NO];

Then register an observer with the default NSNotificationCenter for the JotStylusManagerDiscoveryAttemptedButBluetoothOffNotification and present your custom UI at that time.