Module: siteKiosk.system.android.broadcast

A modules used to subscribe to Android system broadcasts.

Methods

<static> registerReceiver(action, broadcastReceivedCallback) → {siteKiosk.system.android.broadcast~receiver}

Registers a broadcast receiver.
Parameters:
Name Type Description
action string An Android broadcast intent action string
broadcastReceivedCallback siteKiosk.system.android.broadcast~receivedCallback A callback, to be invoked when the system received a broadcast
Returns:
A broadcast receiver object, used to unsubscribe.
Type
siteKiosk.system.android.broadcast~receiver

<static> sendBroadcast(intent)

Broadcasts a specified Android intent.
Parameters:
Name Type Description
intent siteKiosk.system.android.broadcast~intent | string The Android intent to broadcast or the action of the intent

Type Definitions

intent

An Android intent
Type:
  • Object
Properties:
Name Type Argument Description
action string <optional>
The intent's action
data string <optional>
The intent's data URI
categories Array.<string> <optional>
The intent's categories
type string <optional>
The intent's MIME type
component string <optional>
The intent's flattened component name
extras Array.<siteKiosk.system.android.broadcast~intentExtra> <optional>
The intent's extras
flags number <optional>
The intent's integer flags

intentExtra

An extra attached to an intent
Type:
  • Object
Properties:
Name Type Description
key string The extra's key
type string The extra's type ("boolean" | "byte" | "char" | "short" | "int" | "float" | "double" | "string" | "charSequence")
value string The extra's serialized value

receivedCallback(extras)

This callback is invoked when the system received a broadcast.
Parameters:
Name Type Description
extras Object An object containing the extras of the event

receiver

A broadcast receiver, which receives system events.
Type:
  • Object
Properties:
Name Type Description
remove function A function to remove the broadcast receiver and unsubscribe the event