java.lang.Object | |
↳ | com.google.android.gms.nearby.messages.MessageListener |
A listener for receiving subscribed messages. These callbacks will be delivered when messages are found or lost.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when the Bluetooth Low Energy (BLE) signal associated with a message changes.
| |||||||||||
Called when Nearby's estimate of the distance to a message changes.
| |||||||||||
Called when messages are found.
| |||||||||||
Called when a message is no longer detectable nearby.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Called when the Bluetooth Low Energy (BLE) signal associated with a message changes.
For example, this is called when we see the first BLE advertisement frame associated with a message; or when we see subsequent frames with different RSSI.
Note: This callback currently only works for BLE beacon messages.
Note: This callback is not supported by the version of subscribe(GoogleApiClient, PendingIntent)
that takes a PendingIntent
.
Parameters | |
---|---|
message |
Message
|
bleSignal |
BleSignal
|
Called when Nearby's estimate of the distance to a message changes.
For example, this is called when we first gather enough information to make a distance estimate; or when the message remains nearby, but gets closer or further away.
Note: This callback currently only works for BLE beacon messages.
Note: This callback is not supported by the version of subscribe(GoogleApiClient, PendingIntent)
that takes a PendingIntent
.
Parameters | |
---|---|
message |
Message :
The message whose distance changed. |
distance |
Distance :
The new distance estimate.
|
Called when messages are found.
This method is called the first time the message is seen nearby. After a message has been
lost (see onLost(Message)
), it's eligible for onFound(Message)
again.
Parameters | |
---|---|
message |
Message :
The found message.
|
Called when a message is no longer detectable nearby.
Note: This callback currently works best for BLE beacon messages. For other messages, it may not be called in a timely fashion, or at all.
This method will not be called repeatedly (unless the message is found again between lost calls).
Parameters | |
---|---|
message |
Message :
The lost message.
|