AppBeaconStatus Method (CLIENT)
PLB Web Only, 9.9A
The AppBeaconStatus method retrieves the status of beacon capabilities for a mobile device. The method uses the following format:
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A CLIENT object that has been declared.
return
Optional. A Numeric Variable that returns the success or failure of the method.
flags
Optional. A Numeric Variable or decimal number that specifies a bit mask value that controls the operations of this method.
Flags Affected: OVER, ZERO
Note the following:
Beacon support is only available when using a 'PlbWebCli' client for an Android or iOS device.
The beacon support is provided using the Cordova plugin found at the following URL:
All beacon interactions and generated events are produced directly from this Cordova plugin package.
The requested status information is returned to the PL/B program as a JSON string in the ARG1 result variable for an event named 'AppEventBeaconStatus'. Therefore, EVENTREGISTER instruction must be executed to register the 'AppEventBeaconStatus' event before this method is executed.
The ZERO flag is set if the {return} value is zero indicating that the method execution was successful.
The OVER flag is set if the value returned is too large to be stored into the {return} variable.
The {return} value is zero when the method executes successfully. Otherwise, the {return} value is an error value as follows:
|
Error |
Value |
Description |
|
AppErrorNone |
0 |
No error. |
|
AppErrorNoCordovaSupport |
1 |
Action not supported by Cordova. |
|
AppErrorWithExtendedInfo |
2 |
Error with extended information. See CLIENT method named 'AppExtendedError'. |
The {flags} parameter is numeric value reserved for future bit mask values to control the behaviors of this method.
The AppBeaconStatus method operation is performed by the Cordova plugin. The resulting data is returned to the PL/B program as an event named 'AppEventBeaconStatus' which must be registered using an EVENTREGISTER instruction before this method is executed. The resulting data is stored as a JSON string value in the ARG1 result variable. The event number used to register the Beacon status event using EVENTREGISTER is defined as follows:
|
Event |
Value |
|
AppEventBeaconStatus |
126 |
The ARG1 JSON string result fields are defined as follows:
|
Field Name |
Value |
|
isBluetoothEnabled |
boolean and valid for Android only |
|
isRangingAvailable |
boolean (can AppBeaconRangeStart be used) |
|
getAuthorizationStatus |
object with one field |
|
authorizationStatus |
string value (e.g., AuthorizationStatusAuthorized) |
Sample Event JSON string data:
Example:
See Also: CLIENT, Client Methods, Method Syntax
![]() |