# PublishCallback

public abstract class **PublishCallback** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Callback for events which affect published messages.

##### See Also

- `https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/PublishOptions`

### Public Constructor Summary

|---|---|
|   | [PublishCallback](https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/PublishCallback#PublishCallback())() |

### Public Method Summary

|---|---|
| void | [onExpired](https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/PublishCallback#onExpired())() The published message is expired. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | 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.