RemoteNotification

Enterprise Browser 2.5

Overview

Remote Notification APIs enable Enterprise Browser applications to control device annunciators such as the beeper, vibrator and multi-color LEDs to notify the user of custom events in their workflow.

This API is supported only on Android devices with the Zebra RS6000 and External Vibrator (CBL-NGWT-HDVBAP-01).

Enabling the API

There are two methods of enabling the RemoteNotification API:

  • Include all 'ebapi' modules
  • Include only the required API modules

Both methods are explained below.

Either way, the included files will be found in: /Enterprise Browser/JavaScript Files/Enterprise Browser, a directory on the computer that contains the Enterprise Browser installation.

Include all API modules

To include all JavaScript APIs, copy the ebapi-modules.js file to a location accessible by the app's files and include the JavaScript modules file in the app. For instance, to include the modules file in the index.html file, copy the file to the same directory as the index.html and add the following line to the HEAD section of the index.html:

    
    <script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>

The code above defines the EB class within the page. Note that the path for this file is relative to the current page (index.html). Any page on which the modules are required must include a reference to the required .js file(s) in this fashion.

Include only the required modules

To include individual APIs, first include a reference to the ebapi.js module in the HTML, and then the additional required API file(s). For instance, to use the Remote Notification API, add the following code to the HTML file(s). Again, this assumes that relevant API files have been copied to the same directory as the HTML.


<script type="text/javascript" charset="utf-8" src="ebapi.js"></script>
<script type="text/javascript" charset="utf-8" src="eb.remotenotification.js"></script>

In the lines above, notice that ebapi.js is included first, followed by eb.remotenotification.js, which is the Remote Notification API for Enterprise Browser. This coding is required on each HTML page whenever an individual API will be called from that page.

Methods

cancelNotification()

                This cancels the active notification from the device.
                m_rnobject.cancelNotification();

Parameters

  • callback : CallBackHandler

Returns

Synchronous Return:

  • Void

Platforms

  • Android

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.cancelNotification()
  • Default Instance: This method can be accessed via the default instance object of this class.
    • EB.Remotenotification.cancelNotification()

clearproperties()

                Clears all properties related to led,vibrator and beeper settings.
                m_rnobject.clearproperties();

Parameters

  • callback : CallBackHandler

Returns

Synchronous Return:

  • Void

Platforms

  • Android

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.clearproperties()
  • Default Instance: This method can be accessed via the default instance object of this class.
    • EB.Remotenotification.clearproperties()

disable()

                Disables the remote notification device.
                m_rnobject.disable();

Parameters

  • callback : CallBackHandler

Returns

Synchronous Return:

  • Void

Platforms

  • Android

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.disable()
  • Default Instance: This method can be accessed via the default instance object of this class.
    • EB.Remotenotification.disable()

enable()

                Enables the remote notification device.
                rnArray = EB.Remotenotification.enumerate();
                m_rnobject = rnArray[0];
                m_rnobject.enable();

Parameters

  • callback : CallBackHandler

Returns

Synchronous Return:

  • Void

Platforms

  • Android

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.enable()
  • Default Instance: This method can be accessed via the default instance object of this class.
    • EB.Remotenotification.enable()

enumerate()

Parameters

  • callback : CallBackHandler

Callback

Async Callback Returning Parameters: ARRAY

    • Object : SELF_INSTANCE: EB.Remotenotification

Returns

Synchronous Return:

  • ARRAY : Array of Remotenotification objects. var rnArray; rnArray = EB.Remotenotification.enumerate();
    • Object : SELF_INSTANCE: EB.Remotenotification

Platforms

  • Android

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • EB.Remotenotification.enumerate()

notify(HASH notifyinfo)

Notify method sends the notification information to the device.

Parameters

  • notifyinfo : HASH Optional

    The properties associated with the notifyinfo. Not providing properties to this function will use the notification device's default properties, or those previously set on the remote notification instance.

    • beepPattern : Array Default:

      An array of Beep that specifies the durations for which to turn on the beep in milliseconds and the frequency in Hz. Default value assigned is null. Maximum allowed are 4 beep pattern pairs. If more than 4 pattern pairs are provided, only the first 4 pattern pairs will be considered. { beepPattern:[ {beeptime:500,beepfrequency:3000}, {beeptime:500,beepfrequency:0}, {beeptime:500,beepfrequency:3000}, {beeptime:500,beepfrequency:0}, {beeptime:500,beepfrequency:3000}, {beeptime:500,beepfrequency:0} ]

    • vibratorPattern : Array Default:

      Vibrate with a given pattern. Pass in an array of integers that are the durations for which to turn on or off the vibrator in milliseconds. The supported values are 0ms to 2550ms. Behavior is undefined for any other value. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next value indicates the number of milliseconds for which to keep the vibrator on before turning it off. Subsequent values alternate between durations in milliseconds to turn the vibrator off or to turn the vibrator on. Maximum 4 vibrating pattern pairs are supported. If more than 4 pattern pairs are provided, only the first 4 pattern pairs will be considered. Default value assigned is null. Note: This parameter is not supported for External Vibrator. vibratorPattern:[ {vibratortime:500}, {vibratortime:500}, {vibratortime:500}, {vibratortime:500}, {vibratortime:500}, {vibratortime:500} ]

    • ledonTime : INTEGER Default:

      the number of milliseconds for the LED to be ON while it's flashing. Default value assigned is 0. The supported values are 0ms to 2550ms. Behavior is undefined for any other value..

    • ledoffTime : INTEGER Default:

      The number of milliseconds for the LED to be OFF while it's flashing. Default value assigned is 0. The supported values are 0ms to 2550ms. Behavior is undefined for any other value.

    • ledrepeatCount : INTEGER Default:

      The LED blinking repeat count. Default value assigned is 0. The supported values are 0 to 127 for RS6000. Setting -1 or above 127 will flash the LED infinitely for RS6000. Note: The repeatCount is used for additional LED blinks. Example: Setting repeatCount = 0 will blink the LED once, setting repeatCount = 1 will blink the LED twice, etc.

    • ledcolor : STRING Default:

      The color for blinking LED on the notification device using RGB format. Ex: #FF0000 for Red.The Default value of ledcolor is set to black(#000000).So led will not glow if the ledcolor is balck. So it is recommended to specify the ledcolor value(other than black) before calling notify.

    • vibrationDuration : INTEGER Default:

      The vibration time in milliseconds. Default value is assigned to 0. If the pattern array is null, this time will be used otherwise pattern takes precedence. The supported values are 0ms to 2550ms. Behavior is undefined for any other value.

  • callback : CallBackHandler

Returns

Synchronous Return:

  • Void

Platforms

  • Android

Method Access:

  • Instance Method: This method can be accessed via an instance object of this class:
    • myObject.notify(HASH notifyinfo)
  • Default Instance: This method can be accessed via the default instance object of this class.
    • EB.Remotenotification.notify(HASH notifyinfo)

Properties

connectionType

Type

STRING Read Only

Description

Returns the notification device connection type to mobile computer.

Values

Possible Values (STRING):

  • Constant: EB.Remotenotification.BLUETOOTH_SSI - String: BLUETOOTH_SSI Bluetooth SSI Scanner
  • Constant: EB.Remotenotification.PLUGGABLE - String: PLUGGABLE Pluggable scanner
  • Constant: EB.Remotenotification.UNDEFINED - String: UNDEFINED Undefined connection type

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.connectionType
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.connectionType

Platforms

  • Android

deviceType

Type

STRING Read Only

Description

Returns the notification device type.

Values

Possible Values (STRING):

  • Constant: EB.Remotenotification.IMAGER - String: IMAGER IMAGER device
  • Constant: EB.Remotenotification.UNDEFINED - String: UNDEFINED Undefined device type
  • Constant: EB.Remotenotification.VIBRATOR - String: VIBRATOR Not supported yet

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.deviceType
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.deviceType

Platforms

  • Android

friendlyName

Type

STRING Read Only

Description

Returns the friendly name of the notification device.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.friendlyName
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.friendlyName

Platforms

  • Android

isBeepSupported

Type

BOOLEAN Read Only

Description

Returns true if the notification device supports Beep feature else false.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isBeepSupported
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isBeepSupported

Platforms

  • Android

isConnected

Type

BOOLEAN Read Only

Description

Returns whether the notification device is connected to the Mobile device or not.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isConnected
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isConnected

Platforms

  • Android

isDefaultDevice

Type

BOOLEAN Read Only

Description

Returns true if it is a default notification device else false.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isDefaultDevice
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isDefaultDevice

Platforms

  • Android

isEnabled

Type

BOOLEAN Read Only

Description

Returns whether the notification device is enabled or not.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isEnabled
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isEnabled

Platforms

  • Android

isLEDSupported

Type

BOOLEAN Read Only

Description

Returns true if the notification device supports LED feature else false.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isLEDSupported
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isLEDSupported

Platforms

  • Android

isVibrateSupported

Type

BOOLEAN Read Only

Description

Returns true if the notification device supports Vibrate feature else false.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.isVibrateSupported
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.isVibrateSupported

Platforms

  • Android

ledcolor

Type

STRING

Description

The color for blinking LED on the notification device using RGB format. Ex: #FF0000 for Red.The Default value of ledcolor is set to black(#000000).So led will not glow if the ledcolor is balck. So it is recommended to specify the ledcolor value(other than black) before calling notify.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.ledcolor
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.ledcolor

Platforms

  • Android

ledoffTime

Type

INTEGER

Description

The number of milliseconds for the LED to be OFF while it's flashing. Default value assigned is 0. The supported values are 0ms to 2550ms. Behavior is undefined for any other value.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.ledoffTime
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.ledoffTime

Platforms

  • Android

ledonTime

Type

INTEGER

Description

The number of milliseconds for the LED to be ON while it's flashing. Default value assigned is 0. The supported values are 0ms to 2550ms. Behavior is undefined for any other value.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.ledonTime
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.ledonTime

Platforms

  • Android

ledrepeatCount

Type

INTEGER

Description

The LED blinking repeat count. Default value assigned is 0. The supported values are 0 to 127 for RS6000. Setting -1 or above 127 will flash the LED infinitely for RS6000. Note: The repeatCount is used for additional LED blinks. Example: Setting repeatCount = 0 will blink the LED once, setting repeatCount = 1 will blink the LED twice, etc.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.ledrepeatCount
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.ledrepeatCount

Platforms

  • Android

modelNumber

Type

STRING Read Only

Description

Returns the notification device model number.For Future Use only.Currently Not supported.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.modelNumber
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.modelNumber

Platforms

  • Android

vibrationDuration

Type

INTEGER

Description

The vibration time in milliseconds. Default value is assigned to 0. If the pattern array is null, this time will be used; otherwise pattern takes precedence. The supported values are 0 ms to 2550 ms. Behavior is undefined for any other value. Note: Supported values are 0ms to 300000ms for External Vibrator.

Access

  • Instance: This property can be accessed via an instance object of this class: myObject.vibrationDuration
  • Default Instance: This property can be accessed via the default instance object of this class.
    • EB.Remotenotification.vibrationDuration

Platforms

  • Android

Remarks

Reconnecting to a Device

To reconnect to a device after disconnection, quit and relaunch the Enterprise Browser application; the underlying layer does not support automatic device reconnection for use of the RemoteNotification object.