The easiest way to integrate the SensorbergSDK is via CocoaPods.
To install it, simply add the following lines to your Podfile:
pod "SensorbergSDK", :git => 'firstname.lastname@example.org:sensorberg-dev/ios-sdk.git', :branch => 'master'
pod 'tolo', '~> 1.0'
Usage and setup
SBManager with an API key and a delegate
[[SBManager sharedManager] setApiKey:apiKey delegate:self];
When ready, tell the SBManager to ask for location authorization
[[SBManager sharedManager] requestLocationAuthorization];
- Be sure to add the
NSLocationAlwaysUsageDescriptionkey to your plist file and the corresponding string to explain the user why the app requires access to location.
SBManager will automaticall start scanning for beacon regions you added on the Sensorberg Management Platform.
You can also scan for custom beacon regions by calling
[[SBManager sharedManager] startMonitoring:] and passing a list of custom UUID strings.
The SensorbergSDK uses an EventBus for events dispatch. During setup, you pass the class instance that will receive the events as the delegate.
If you want to receive events in other class insances also, simply call
REGISTER(); and subscribe to the events.
The Sensorberg SDK requires iOS 8.0 Sensorberg SDK uses:
- AFNetworking for network communication
- JSONModel for JSON parsing
- UICKeyChainStore for keychain access
- tolo for event communication
Sensorberg SDK is available under the MIT license. See the LICENSE file for more info.