android-components / mozilla.components.lib.nearby / NearbyConnectionObserver


interface NearbyConnectionObserver (source)

Interface definition for observing changes in a NearbyConnection.


Name Summary
onMessageDelivered abstract fun onMessageDelivered(payloadId: Long): Unit
Called when a message has been successfully delivered to a neighboring device.
onMessageReceived abstract fun onMessageReceived(neighborId: String, neighborName: String?, message: String): Unit
Called when a message is received from a neighboring device.
onStateUpdated abstract fun onStateUpdated(connectionState: ConnectionState): Unit
Called whenever the connection’s state is set. In the absence of failures, the new state should differ from the prior state, but that is not guaranteed.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.