This plugin is the successor of cordova-plugin-gimbal which used Gimbal v1 SDK.
A Cordova plugin for scanning and interacting with Qualcomm Gimbal beacons. Updated for Gimbal SDK v2.
- iOS 7.1+
- Android 4.4.3, 4.4.4, 5.0+ (5.0+ recommended)
Support for previous versions is not possible because the lack of Bluetooth LE support in earlier versions of the platforms.
- Beacon Manager: listen for beacon sightings
- Gimbal Manager account
- Gimbal SDK v2 (latest version can be obtained from Gimbal Manager web app)
- Gimbal beacons (can be bought on Gimbal's online store)
cordova plugin add https://github.com/happydenn/cordova-plugin-gimbal2.git
From the downloaded SDK, drag and drop Gimbal.framework from the Frameworks folder to the Frameworks group inside the Xcode project. Be sure to copy the files when asked by Xcode.
Add the following to your project's Info.plist to enable using Bluetooth beacons in background mode.
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
Finally for iOS 8 and later, you need to add a new entry to your Xcode project's Info.plist to properly request for permission to use the location service which is required by Gimbal SDK.
<key>NSLocationAlwaysUsageDescription</key>
<string>Specifies the reason for accessing the user's location information.</string>
From the downloaded SDK, copy all the jars inside the libs folder to the libs folder located in the Android platform folder.
Next inside the 'platforms/android' folder of your project, create a new file named build-extras.gradle (open the file if it already exists) and add the following lines:
ext.postBuildExtras = {
android {
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
}
}
}
This will get rid of the error while building the Android version.
Initialize the Gimbal SDK with the API key.
- apiKey: API key (generated from Gimbal Manager web backend)
Start the BeaconManager. BeaconManager is responsible for scanning nearby beacons.
Stop the BeaconManager.
Events are fired on the window object. Attach event listeners to handle the events.
Fires when a beacon is scanned by the BeaconManager.
- RSSI: Signal strength of the sighting
- datetime: Time when the sighting occured
- beaconName
- beaconIdentifier
- beaconBatteryLevel
- beaconIconUrl
- beaconTemperature