PublishCallback
Stay organized with collections
Save and categorize content based on your preferences.
Callback for events which affect published messages.
Public Constructor Summary
Public Method Summary
void |
onExpired()
The published message is expired.
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`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."]]],["`PublishCallback` is an abstract class for handling events related to published messages. It includes a constructor and the `onExpired()` method, which is triggered when a published message expires, either due to the time-to-live (TTL) elapsing or the user stopping Nearby actions for the app. Utilizing this callback is recommended to update application state when messages expire. It also inherits methods from the base `Object` class like `equals` and `toString`.\n"]]