So per the documentation Firebase JobDispatcher is deprecated and should be migrated to use the WorkManager. I was following the migration guide which said the functionality implemented in a JobService should be migrated to a ListenableWorker. However I am stumped on how to implement startWork()
, the guide only says
override fun startWork(): ListenableFuture<ListenableWorker.Result> {
// Do your work here.
TODO("Return a ListenableFuture<Result>")
}
I have done a lot of googling but i have not been able to figure out how to implement/use the ListenableFuture in this context to implement the functionality of the JobService, where I called jobFinished
and returned a Boolean value to represent if work was still going on. Any help is appreciated