Functions
The com.voltmx namespace contains the following functions.
com.voltmx.AddPassesViewController Function
Creates an AddPassesViewController object.
Syntax
com.voltmx.AddPassesViewController(
passbookArray,
statusCallback)
Parameters
passbookArray
An optional array of passbooks. Uses only first passbook in the array if the operating system is iOS below 7.0.
statusCallback
Optional callback function that get the status of the AddPassesViewController object that must have the following signature.
statusCallbackFunctionName(status);
where status is a string that contains the status of the AddPassesViewController object
Return Values
Returns a AddPassesViewController object.
Example
var AddPassesViewController1 = new com.voltmx.AddPassesViewController(an, statusCallback);
com.voltmx.BeaconManager Function
Allocates and initializes a BeaconManager object.
Syntax
com.voltmx.BeaconManager(
monitoringCallback,
rangingCallback,
errorCallback)
Parameters
monitoringCallback
An optional callback function that gets beacon region updates from BeaconManager: For details, see the Remarks below.
rangingCallback
An optional callback function that gets ranging updates from BeaconManager: For details, see the Remarks below.
errorCallback
An optional callback function that gets error updates from BeaconManager: For details, see the Remarks below.
Return Values
Returns a BeaconManager object.
Remarks
The monitoringCallback parameter is optional. If you do provide a callback for this parameter, the callback must have the following signature,
function monitoringCallback(beaconRegion, beaconRegionState);
where the parameters to the callback are as follows.
beaconRegion
A com.voltmx.BeaconRegion object containing information about the region that was entered or exited.
beaconRegionState
A string that contains one of the following.
Constant | Description |
---|---|
BeaconRegionStateUnknown | It is unknown whether the device is inside or outside of the region. |
BeaconRegionStateInside | The device is inside the given region. |
BeaconRegionStateOutside | The device is outside of the given region. |
The rangingCallback parameter is also optional. If you provide a callback for this parameter, the callback must have the following signature.
function rangingCallback(beaconRegion, beacons);
where the parameters to the callback are as follows.
beaconRegion
A BeaconRegion object containing the beacon region.
beacons
An array of Beacon objects representing the beacons currently in range (in the order of closest first). Your app can use the information in these objects to determine the range of each beacon and its identifying information.
The rangingCallback parameter is optional. If you provide a callback for this parameter, the callback must have the following signature.
function errorCallback(beaconManagerError, errorName, errorDictionary, beaconRegion);
where the parameters to the callback are as follows.
beaconManagerError
A string containing one of the following values.
Constant | Description |
---|---|
BeaconManagerMonitoringError | An error has occurred while trying to monitor a given region |
BeaconManagerRangingError | The region object is invalid or it contains invalid data. |
BeaconManagerFailedError | The beacon manager was unable to retrieve a location value. |
errorName
A string containing the name of the error.
errorDictionary
A dictionary containing the error information.
beaconRegion
A BeconRegion object that specifies the region where the error occurred.
Example
var aBeaconManager = new com.voltmx.BeaconManager(monitoringCallback, rangingCallback, errorCallback);`
Availability
iOS only.
com.voltmx.BeaconRegion Function
Creates a BeaconRegion object.
Syntax
com.voltmx.BeaconRegion(
proximityUUID,
major,
minor,
identifier1)
Parameters
proximityUUID
A string that contains the identifier that specifies your beacons.
major
A number that contains groups related sets of beacons.
minor
An optional parameter that contains a number that your app can use to specify subgroups of the major parameter.
identifier
A string containing a unique identifier for the BeaconRegion object. This value must not be null.
Return Values
Returns a BeaconRegion object.
Remarks
You usually generate only one UUID for your beacons but can generate more as needed and pass them through the proximityUUID parameter. You can generate UUIDs using the uuidgen command-line tool, which is widely available on the internet, or by using an online UUID generator..
When you are grouping related sets of beacons, you typically do so by location. For example, a bank can assign the same major value for all beacons on the same floor. The bank could also use the optional minor parameter to further subdivide the beacons on that floor into specific subgroups on the floor.
The identifier parameter enables you to specify a unique name for each BeaconRegion object. Therefore, your app can use this identifier to differentiate regions within your application.
Example
var BeaconRegion1 = new com.voltmx.BeaconRegion(UUIDString1, major1, minor1, identifier1)
Availability
Available only on iOS.