Package 

Interface IBackgroundService


  • 
    public interface IBackgroundService
    
                        

    Implement and provide this interface as part of service registration to indicate the service wants to be instantiated and its backgroundRun function called when the app is in the background. Each background service's scheduleBackgroundRunIn will be analyzed to determine when backgroundRun should be called.

    • Method Summary

      Modifier and Type Method Description
      abstract Unit backgroundRun() Run the background service.
      abstract Long getScheduleBackgroundRunIn() When this background service should be run, in milliseconds.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • backgroundRun

        @WorkerThread() abstract Unit backgroundRun()

        Run the background service. WARNING: This may not follow your scheduleBackgroundRunIn schedule: 1. May run more often as the lowest scheduleBackgroundRunIn value is used across the SDK. 2. Android doesn't guarantee exact timing on when the job is run, so it's possible for it to be delayed by a few minutes.

      • getScheduleBackgroundRunIn

         abstract Long getScheduleBackgroundRunIn()

        When this background service should be run, in milliseconds. If null, this service does not need to be run in the background.