PublishCallback

  • PublishCallback handles events related to published messages, like expiration.

  • It provides a way to know when a published message has expired, allowing for UI or state updates.

  • Expiration can occur due to Time-To-Live (TTL) elapsing or user stopping Nearby actions.

  • Developers should use PublishCallback and its onExpired() method to manage message lifecycles effectively.

public abstract class PublishCallback extends Object

Callback for events which affect published messages.

See Also

Public Constructor Summary

Public Method Summary

void
onExpired()
The published message is expired.

Inherited Method Summary

Public Constructors

public PublishCallback ()

Public Methods

public void onExpired ()

The published message is expired.

Called if any of the following happened:

  • The specified TTL for the call elapsed.
  • User stopped the Nearby actions for the app.

Using this callback is recommended for cases when you need to update state (e.g. UI elements) when published messages expire.