目录

CLASS info
public abstract class MessageHandler
Represents the callback for events such as signal change, distance change, message reception, and failure to receive a message.

Public Constructor Summary

Constructor name
public MessageHandler()
Creates an instance of MessageHandler.

Public Method Summary

ReturnMethod
voidonBleSignalChanged(Message message, BleSignal bleSignal)
Called when the first BLE broadcast message associated with a message or when the BLE signal associated with a message changes.
voidonDistanceChanged(Message message, Distance distance)
Called when the estimated distance to a message changes.
voidonFound(Message message)
Called when a message is detected for the first time or a lost message (onLost) is detected again.
voidonLost(Message message)
Called when a message is no longer detectable.

Public Constructors

Constructor
public MessageHandler ()
Creates an instance of MessageHandler.

Public Methods

Method
public void onBleSignalChanged(Message message, BleSignal bleSignal)
Called when the first BLE broadcast message associated with a message or when the BLE signal associated with a message changes. This callback currently supports only BLE beacon messages. It does not support PendingIntent during subscription.

Parameters

Parameter nameParameter desc
messageMessage.
bleSignalNew BLE signal.
Method
public void onDistanceChanged(Message message, Distance distance)
Called when the estimated distance to a message changes. This callback currently supports only BLE beacon messages. It does not support PendingIntent during subscription.

Parameters

Parameter nameParameter desc
messageMessage.
distanceUpdated estimated distance.
Method
public void onFound(Message message)
Called when a message is detected for the first time or a message is no longer detectable (onLost).

Parameters

Parameter nameParameter desc
messageMessage.
Method
public void onLost(Message message)
Called when a message is no longer detectable. This callback currently suits BLE beacon messages the best. For other messages, it may not respond in a timely manner. The method is called back only once unless a message is no longer detectable.

Parameters

Parameter nameParameter desc
messageMessage.