From 1da35968de40470d6a5f1660aa8d2528e3fd0fb4 Mon Sep 17 00:00:00 2001 From: Fabien Duthu Date: Wed, 27 Jul 2016 10:07:33 +0200 Subject: [PATCH 1/3] Estimate beacons plugin class --- src/index.ts | 3 + src/plugins/estimote-beacons.ts | 525 ++++++++++++++++++++++++++++++++ 2 files changed, 528 insertions(+) create mode 100644 src/plugins/estimote-beacons.ts diff --git a/src/index.ts b/src/index.ts index 6a16480e..b55aeb0f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,7 @@ import {DeviceOrientation} from './plugins/deviceorientation'; import {Diagnostic} from './plugins/diagnostic'; import {Dialogs} from './plugins/dialogs'; import {EmailComposer} from './plugins/emailcomposer'; +import {EstimoteBeacons} from './plugins/estimote-beacons'; import {Facebook} from './plugins/facebook'; import {File} from './plugins/file'; import {Transfer} from './plugins/filetransfer'; @@ -129,6 +130,7 @@ export { Dialogs, Diagnostic, EmailComposer, + EstimoteBeacons, File, Flashlight, Geolocation, @@ -190,6 +192,7 @@ window['IonicNative'] = { Dialogs: Dialogs, Diagnostic: Diagnostic, EmailComposer: EmailComposer, + EstimoteBeacons: EstimoteBeacons, Facebook: Facebook, File: File, Flashlight: Flashlight, diff --git a/src/plugins/estimote-beacons.ts b/src/plugins/estimote-beacons.ts new file mode 100644 index 00000000..cabf9d0e --- /dev/null +++ b/src/plugins/estimote-beacons.ts @@ -0,0 +1,525 @@ +import { Cordova, Plugin } from './plugin'; +import { Observable } from 'rxjs/Observable'; + +/** + * @name EstimoteBeacons + * + * @description + * This plugin enables communication between a phone and Estimote Beacons peripherals. + * + */ +@Plugin({ + plugin: 'cordova-plugin-estimote', + pluginRef: 'estimote.beacons', + repo: 'https://github.com/evothings/phonegap-estimotebeacons', + platforms: ['iOS', 'Android'] +}) +export class EstimoteBeacons { + + /** Proximity value */ + public static ProximityUnknown = 0; + + /** Proximity value */ + public static ProximityImmediate = 1; + + /** Proximity value */ + public static ProximityNear = 2; + + /** Proximity value */ + public static ProximityFar = 3; + + /** Beacon colour */ + public static BeaconColorUnknown = 0; + + /** Beacon colour */ + public static BeaconColorMintCocktail = 1; + + /** Beacon colour */ + public static BeaconColorIcyMarshmallow = 2; + + /** Beacon colour */ + public static BeaconColorBlueberryPie = 3; + /** + * Beacon colour. + */ + public static BeaconColorSweetBeetroot = 4; + + /** Beacon colour */ + public static BeaconColorCandyFloss = 5; + + /** Beacon colour */ + public static BeaconColorLemonTart = 6; + + /** Beacon colour */ + public static BeaconColorVanillaJello = 7; + + /** Beacon colour */ + public static BeaconColorLiquoriceSwirl = 8; + + /** Beacon colour */ + public static BeaconColorWhite = 9; + + /** Beacon colour */ + public static BeaconColorTransparent = 10; + + /** Region state */ + public static RegionStateUnknown = 'unknown'; + + /** Region state */ + public static RegionStateOutside = 'outside'; + + /** Region state */ + public static RegionStateInside = 'inside'; + + /** + * Ask the user for permission to use location services + * while the app is in the foreground. + * You need to call this function or requestAlwaysAuthorization + * on iOS 8+. + * Does nothing on other platforms. + * + * @usage + * ``` + * EstimoteBeacons.requestWhenInUseAuthorization().then( + * () => { console.log('on success'); }, + * () => { console.log('on error'); } + * ); + * ``` + * + * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} + * @return Returns a Promise. + */ + @Cordova() + static requestWhenInUseAuthorization(): Promise { return; } + + /** + * Ask the user for permission to use location services + * whenever the app is running. + * You need to call this function or requestWhenInUseAuthorization + * on iOS 8+. + * Does nothing on other platforms. + * + * @usage + * ``` + * EstimoteBeacons.requestAlwaysAuthorization().then( + * () => { console.log('on success'); }, + * () => { console.log('on error'); } + * ); + * ``` + * + * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} + * @return Returns a Promise. + */ + @Cordova() + static requestAlwaysAuthorization(): Promise { return; } + + /** + * Get the current location authorization status. + * Implemented on iOS 8+. + * Does nothing on other platforms. + * + * @usage + * ``` + * EstimoteBeacons.authorizationStatus().then( + * (result) => { console.log('Location authorization status: ' + result); }, + * (errorMessage) => { console.log('Error: ' + errorMessage); } + * ); + * ``` + * + * @see {@link https://community.estimote.com/hc/en-us/articles/203393036-Estimote-SDK-and-iOS-8-Location-Services|Estimote SDK and iOS 8 Location Services} + * @return Returns a Promise. + */ + @Cordova() + static authorizationStatus(): Promise { return; } + + /** + * Start advertising as a beacon. + * + * @usage + * ``` + * EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion') + * .then(() => { console.log('Beacon started'); }); + * setTimeout(() => { + * EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); }); + * }, 5000); + * ``` + * @param uuid {string} UUID string the beacon should advertise (mandatory). + * @param major {number} Major value to advertise (mandatory). + * @param minor {number} Minor value to advertise (mandatory). + * @param regionId {string} Identifier of the region used to advertise (mandatory). + * @return Returns a Promise. + */ + @Cordova({ + clearFunction: 'stopAdvertisingAsBeacon' + }) + static startAdvertisingAsBeacon(uuid: string, major: number, minor: number, regionId: string): Promise { return; } + + /** + * Stop advertising as a beacon. + * + * @usage + * ``` + * EstimoteBeacons.startAdvertisingAsBeacon('B9407F30-F5F8-466E-AFF9-25556B57FE6D', 1, 1, 'MyRegion') + * .then(() => { console.log('Beacon started'); }); + * setTimeout(() => { + * EstimoteBeacons.stopAdvertisingAsBeacon().then((result) => { console.log('Beacon stopped'); }); + * }, 5000); + * ``` + * @return Returns a Promise. + */ + @Cordova() + static stopAdvertisingAsBeacon(): Promise { return; } + + /** + * Enable analytics. + * + * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} + * + * @usage + * ``` + * EstimoteBeacons.enableAnalytics(true).then(() => { console.log('Analytics enabled'); }); + * ``` + * @param enable {number} Boolean value to turn analytics on or off (mandatory). + * @return Returns a Promise. + */ + @Cordova() + static enableAnalytics(enable: boolean): Promise { return; } + + /** + * Test if analytics is enabled. + * + * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} + * + * @usage + * ``` + * EstimoteBeacons.isAnalyticsEnabled().then((enabled) => { console.log('Analytics enabled: ' + enabled); }); + * ``` + * @return Returns a Promise. + */ + @Cordova() + static isAnalyticsEnabled(): Promise { return; } + + /** + * Test if App ID and App Token is set. + * + * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} + * + * @usage + * ``` + * EstimoteBeacons.isAuthorized().then((isAuthorized) => { console.log('App ID and App Token is set: ' + isAuthorized); }); + * ``` + * @return Returns a Promise. + */ + @Cordova() + static isAuthorized(): Promise { return; } + + /** + * Set App ID and App Token. + * + * @see {@link http://estimote.github.io/iOS-SDK/Classes/ESTConfig.html|Further details} + * + * @usage + * ``` + * EstimoteBeacons.setupAppIDAndAppToken('MyAppID', 'MyAppToken').then(() => { console.log('AppID and AppToken configured!'); }); + * ``` + * @param appID {string} The App ID (mandatory). + * @param appToken {string} The App Token (mandatory). + * @return Returns a Promise. + */ + @Cordova() + static setupAppIDAndAppToken(appID: string, appToken: string): Promise { return; } + + /** + * Beacon region object. + * @typedef {Object} BeaconRegion + * @property {string} identifier Region identifier + * (id set by the application, not related actual beacons). + * @property {string} uuid The UUID of the region. + * @property {number} major The UUID major value of the region. + * @property {number} major The UUID minor value of the region. + */ + + /** + * Beacon info object. Consists of a region and an array of beacons. + * @typedef {Object} BeaconInfo + * @property {BeaconRegion} region Beacon region. Not available when scanning on iOS. + * @property {Beacon[]} beacons Array of {@link Beacon} objects. + */ + + /** + * Beacon object. Different properties are available depending on + * platform (iOS/Android) and whether scanning (iOS) or ranging (iOS/Android). + * @typedef {Object} Beacon + * @property {number} major Major value of the beacon (ranging/scanning iOS/Android). + * @property {number} color One of the estimote.beacons.BeaconColor* values (ranging/scanning iOS/Android). + * @property {number} rssi - The Received Signal Strength Indication (ranging/scanning, iOS/Android). + * @property {string} proximityUUID - UUID of the beacon (ranging iOS/Android) + * @property {number} proximity One of estimote.beacons.Proximity* values (ranging iOS). + * @property {string} macAddress (scanning iOS, ranging Android). + * @property {number} measuredPower (scanning iOS, ranging Android). + * @property {string} name The name advertised by the beacon (ranging Android). + * @property {number} distance Estimated distance from the beacon in meters (ranging iOS). + */ + + /** + * Region state object. This object is given as a result when + * monitoring for beacons. + * @typedef {Object} RegionState + * @property {string} identifier Region identifier + * (id set by the application, not related actual beacons). + * @property {string} uuid The UUID of the region. + * @property {number} major The UUID major value of the region. + * @property {number} major The UUID minor value of the region. + * @property {string} state One of + * {@link estimote.beacons.RegionStateInside}, + * {@link estimote.beacons.RegionStateOutside}, + * {@link estimote.beacons.RegionStateUnknown}. + */ + + /** + * Start scanning for all nearby beacons using CoreBluetooth (no region object is used). + * Available on iOS. + * + * @usage + * ``` + * EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => { + * console.log(JSON.stringify(beacons)); + * }); + * setTimeout(() => { + * EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); }); + * }, 5000); + * ``` + * @return Returns an Observable that notifies of each beacon discovered. + */ + @Cordova({ + observable: true, + clearFunction: 'stopEstimoteBeaconDiscovery' + }) + static startEstimoteBeaconDiscovery(): Observable { return; } + + /** + * Stop CoreBluetooth scan. Available on iOS. + * + * @usage + * ``` + * EstimoteBeacons.startEstimoteBeaconDiscovery().subscribe(beacons => { + * console.log(JSON.stringify(beacons)); + * }); + * setTimeout(() => { + * EstimoteBeacons.stopEstimoteBeaconDiscovery().then(() => { console.log('scan stopped'); }); + * }, 5000); + * ``` + * @return returns a Promise. + */ + @Cordova() + static stopEstimoteBeaconDiscovery(): Promise { return; } + + /** + * Start ranging beacons. Available on iOS and Android. + * + * @usage + * ``` + * let region: BeaconRegion = {} // Empty region matches all beacons. + * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { + * console.log(JSON.stringify(info)); + * }); + * setTimeout(() => { + * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); + * }, 5000); + * ``` + * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @return Returns an Observable that notifies of each beacon discovered. + */ + @Cordova({ + observable: true, + clearFunction: 'stopRangingBeaconsInRegion' + }) + static startRangingBeaconsInRegion(region: BeaconRegion): Observable { return; } + + /** + * Stop ranging beacons. Available on iOS and Android. + * + * @usage + * ``` + * let region: BeaconRegion = {} // Empty region matches all beacons. + * EstimoteBeacons.startRangingBeaconsInRegion(region).subscribe(info => { + * console.log(JSON.stringify(info)); + * }); + * setTimeout(() => { + * EstimoteBeacons.stopRangingBeaconsInRegion(region).then(() => { console.log('scan stopped'); }); + * }, 5000); + * ``` + * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @return returns a Promise. + */ + @Cordova() + static stopRangingBeaconsInRegion(region: BeaconRegion): Promise { return; } + + /** + * Start ranging secure beacons. Available on iOS. + * This function has the same parameters/behaviour as + * {@link EstimoteBeacons.startRangingBeaconsInRegion}. + * To use secure beacons set the App ID and App Token using + * {@link EstimoteBeacons.setupAppIDAndAppToken}. + */ + @Cordova({ + observable: true, + clearFunction: 'stopRangingSecureBeaconsInRegion' + }) + static startRangingSecureBeaconsInRegion(region: BeaconRegion): Observable { return; } + + /** + * Stop ranging secure beacons. Available on iOS. + * This function has the same parameters/behaviour as + * {@link EstimoteBeacons.stopRangingBeaconsInRegion}. + */ + @Cordova() + static stopRangingSecureBeaconsInRegion(region: BeaconRegion): Promise { return; } + + /** + * Start monitoring beacons. Available on iOS and Android. + * + * @usage + * ``` + * let region: BeaconRegion = {} // Empty region matches all beacons. + * EstimoteBeacons.startMonitoringForRegion(region).subscribe(state => { + * console.log('Region state: ' + JSON.stringify(state)); + * }); + * ``` + * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @param [notifyEntryStateOnDisplay=false] {boolean} Set to true to detect if you + * are inside a region when the user turns display on, see + * {@link https://developer.apple.com/library/prerelease/ios/documentation/CoreLocation/Reference/CLBeaconRegion_class/index.html#//apple_ref/occ/instp/CLBeaconRegion/notifyEntryStateOnDisplay|iOS documentation} + * for further details (optional, defaults to false, iOS only). + * @return Returns an Observable that notifies of each region state discovered. + */ + @Cordova({ + observable: true, + clearFunction: 'stopMonitoringForRegion', + successIndex: 1, + errorIndex: 2 + }) + static startMonitoringForRegion(region: BeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } + + /** + * Stop monitoring beacons. Available on iOS and Android. + * + * @usage + * ``` + * let region: BeaconRegion = {} // Empty region matches all beacons. + * EstimoteBeacons.stopMonitoringForRegion(region).then(() => { console.log('monitoring is stopped'); }); + * ``` + * @param region {BeaconRegion} Dictionary with region properties (mandatory). + * @return returns a Promise. + */ + @Cordova() + static stopMonitoringForRegion(region: BeaconRegion): Promise { return; } + + /** + * Start monitoring secure beacons. Available on iOS. + * This function has the same parameters/behaviour as + * EstimoteBeacons.startMonitoringForRegion. + * To use secure beacons set the App ID and App Token using + * {@link EstimoteBeacons.setupAppIDAndAppToken}. + * @see {@link EstimoteBeacons.startMonitoringForRegion} + */ + @Cordova({ + observable: true, + clearFunction: 'stopSecureMonitoringForRegion', + successIndex: 1, + errorIndex: 2 + }) + static startSecureMonitoringForRegion(region: BeaconRegion, notifyEntryStateOnDisplay: boolean): Observable { return; } + + + /** + * Stop monitoring secure beacons. Available on iOS. + * This function has the same parameters/behaviour as + * {@link EstimoteBeacons.stopMonitoringForRegion}. + */ + @Cordova() + static stopSecureMonitoringForRegion(region: BeaconRegion): Promise { return; } + + /** + * Connect to Estimote Beacon. Available on Android. + * + * @usage + * ``` + * EstimoteBeacons.connectToBeacon(FF:0F:F0:00:F0:00); + * ``` + * ``` + * EstimoteBeacons.connectToBeacon({ + * proximityUUID: '000000FF-F00F-0FF0-F000-000FF0F00000', + * major: 1, + * minor: 1 + * }); + * ``` + * @param beacon {Beacon} Beacon to connect to. + * @return returns a Promise. + */ + @Cordova() + static connectToBeacon(beacon: any): Promise { return; } + + /** + * Disconnect from connected Estimote Beacon. Available on Android. + * + * @usage + * ``` + * EstimoteBeacons.disconnectConnectedBeacon(); + * ``` + * @return returns a Promise. + */ + @Cordova() + static disconnectConnectedBeacon(): Promise { return; } + + /** + * Write proximity UUID to connected Estimote Beacon. Available on Android. + * + * @usage + * ``` + * // Example that writes constant ESTIMOTE_PROXIMITY_UUID + * EstimoteBeacons.writeConnectedProximityUUID(ESTIMOTE_PROXIMITY_UUID); + * + * @param uuid {string} String to write as new UUID + * @return returns a Promise. + */ + @Cordova() + static writeConnectedProximityUUID(uuid: any): Promise { return; } + + /** + * Write major to connected Estimote Beacon. Available on Android. + * + * @usage + * ``` + * // Example that writes 1 + * EstimoteBeacons.writeConnectedMajor(1); + * + * @param major {number} number to write as new major + * @return returns a Promise. + */ + @Cordova() + static writeConnectedMajor(major: number): Promise { return; } + + /** + * Write minor to connected Estimote Beacon. Available on Android. + * + * @usage + * ``` + * // Example that writes 1 + * EstimoteBeacons.writeConnectedMinor(1); + * + * @param minor {number} number to write as new minor + * @return returns a Promise. + */ + @Cordova() + static writeConnectedMinor(minor: number): Promise { return; } + +} + +export interface BeaconRegion { + state?: string; + major: number; + minor: number; + identifier?: string; + uuid: string; +} From 080c5a19e68f467198227f82475ab0d8c07edfe0 Mon Sep 17 00:00:00 2001 From: Fabien Duthu Date: Sun, 31 Jul 2016 21:14:45 +0200 Subject: [PATCH 2/3] Added missing clearWithArgs option to the @Cordova decorator --- src/plugins/estimote-beacons.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/estimote-beacons.ts b/src/plugins/estimote-beacons.ts index cabf9d0e..befd3a14 100644 --- a/src/plugins/estimote-beacons.ts +++ b/src/plugins/estimote-beacons.ts @@ -332,7 +332,8 @@ export class EstimoteBeacons { */ @Cordova({ observable: true, - clearFunction: 'stopRangingBeaconsInRegion' + clearFunction: 'stopRangingBeaconsInRegion', + clearWithArgs: true }) static startRangingBeaconsInRegion(region: BeaconRegion): Observable { return; } @@ -364,7 +365,8 @@ export class EstimoteBeacons { */ @Cordova({ observable: true, - clearFunction: 'stopRangingSecureBeaconsInRegion' + clearFunction: 'stopRangingSecureBeaconsInRegion', + clearWithArgs: true }) static startRangingSecureBeaconsInRegion(region: BeaconRegion): Observable { return; } @@ -396,6 +398,7 @@ export class EstimoteBeacons { @Cordova({ observable: true, clearFunction: 'stopMonitoringForRegion', + clearWithArgs: true, successIndex: 1, errorIndex: 2 }) @@ -426,6 +429,7 @@ export class EstimoteBeacons { @Cordova({ observable: true, clearFunction: 'stopSecureMonitoringForRegion', + clearWithArgs: true, successIndex: 1, errorIndex: 2 }) From af392821914c06d58e597809b4f4a2eb3fd40603 Mon Sep 17 00:00:00 2001 From: Fabien Duthu Date: Mon, 22 Aug 2016 15:37:51 +0200 Subject: [PATCH 3/3] Removed 'public' before the property names and cleaned c/p extra docs --- src/plugins/estimote-beacons.ts | 83 +++++++-------------------------- 1 file changed, 18 insertions(+), 65 deletions(-) diff --git a/src/plugins/estimote-beacons.ts b/src/plugins/estimote-beacons.ts index befd3a14..2896120c 100644 --- a/src/plugins/estimote-beacons.ts +++ b/src/plugins/estimote-beacons.ts @@ -17,59 +17,59 @@ import { Observable } from 'rxjs/Observable'; export class EstimoteBeacons { /** Proximity value */ - public static ProximityUnknown = 0; + static ProximityUnknown = 0; /** Proximity value */ - public static ProximityImmediate = 1; + static ProximityImmediate = 1; /** Proximity value */ - public static ProximityNear = 2; + static ProximityNear = 2; /** Proximity value */ - public static ProximityFar = 3; + static ProximityFar = 3; /** Beacon colour */ - public static BeaconColorUnknown = 0; + static BeaconColorUnknown = 0; /** Beacon colour */ - public static BeaconColorMintCocktail = 1; + static BeaconColorMintCocktail = 1; /** Beacon colour */ - public static BeaconColorIcyMarshmallow = 2; + static BeaconColorIcyMarshmallow = 2; /** Beacon colour */ - public static BeaconColorBlueberryPie = 3; + static BeaconColorBlueberryPie = 3; /** * Beacon colour. */ - public static BeaconColorSweetBeetroot = 4; + static BeaconColorSweetBeetroot = 4; /** Beacon colour */ - public static BeaconColorCandyFloss = 5; + static BeaconColorCandyFloss = 5; /** Beacon colour */ - public static BeaconColorLemonTart = 6; + static BeaconColorLemonTart = 6; /** Beacon colour */ - public static BeaconColorVanillaJello = 7; + static BeaconColorVanillaJello = 7; /** Beacon colour */ - public static BeaconColorLiquoriceSwirl = 8; + static BeaconColorLiquoriceSwirl = 8; /** Beacon colour */ - public static BeaconColorWhite = 9; + static BeaconColorWhite = 9; /** Beacon colour */ - public static BeaconColorTransparent = 10; + static BeaconColorTransparent = 10; /** Region state */ - public static RegionStateUnknown = 'unknown'; + static RegionStateUnknown = 'unknown'; /** Region state */ - public static RegionStateOutside = 'outside'; + static RegionStateOutside = 'outside'; /** Region state */ - public static RegionStateInside = 'inside'; + static RegionStateInside = 'inside'; /** * Ask the user for permission to use location services @@ -229,53 +229,6 @@ export class EstimoteBeacons { @Cordova() static setupAppIDAndAppToken(appID: string, appToken: string): Promise { return; } - /** - * Beacon region object. - * @typedef {Object} BeaconRegion - * @property {string} identifier Region identifier - * (id set by the application, not related actual beacons). - * @property {string} uuid The UUID of the region. - * @property {number} major The UUID major value of the region. - * @property {number} major The UUID minor value of the region. - */ - - /** - * Beacon info object. Consists of a region and an array of beacons. - * @typedef {Object} BeaconInfo - * @property {BeaconRegion} region Beacon region. Not available when scanning on iOS. - * @property {Beacon[]} beacons Array of {@link Beacon} objects. - */ - - /** - * Beacon object. Different properties are available depending on - * platform (iOS/Android) and whether scanning (iOS) or ranging (iOS/Android). - * @typedef {Object} Beacon - * @property {number} major Major value of the beacon (ranging/scanning iOS/Android). - * @property {number} color One of the estimote.beacons.BeaconColor* values (ranging/scanning iOS/Android). - * @property {number} rssi - The Received Signal Strength Indication (ranging/scanning, iOS/Android). - * @property {string} proximityUUID - UUID of the beacon (ranging iOS/Android) - * @property {number} proximity One of estimote.beacons.Proximity* values (ranging iOS). - * @property {string} macAddress (scanning iOS, ranging Android). - * @property {number} measuredPower (scanning iOS, ranging Android). - * @property {string} name The name advertised by the beacon (ranging Android). - * @property {number} distance Estimated distance from the beacon in meters (ranging iOS). - */ - - /** - * Region state object. This object is given as a result when - * monitoring for beacons. - * @typedef {Object} RegionState - * @property {string} identifier Region identifier - * (id set by the application, not related actual beacons). - * @property {string} uuid The UUID of the region. - * @property {number} major The UUID major value of the region. - * @property {number} major The UUID minor value of the region. - * @property {string} state One of - * {@link estimote.beacons.RegionStateInside}, - * {@link estimote.beacons.RegionStateOutside}, - * {@link estimote.beacons.RegionStateUnknown}. - */ - /** * Start scanning for all nearby beacons using CoreBluetooth (no region object is used). * Available on iOS.