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.
  
  
  
    
      [null,null,["Last updated 2024-10-31 UTC."],[],["`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"]]