I have a basic work manager
class BackgroundSyncWorker (
appContext: Context,
workerParams: WorkerParameters
): Worker(appContext, workerParams) {
override fun doWork(): Result {
return Result.success()
}
}
And I want to inject my repository into this to do some work in my database. I've set Koin up correctly but can't seem to find a way of how to inject my dependency into the Worker. I've tried inheriting the KoinComponent and trying to do it using that, but by inject()
doesn't exist, but there's two by inject
methods that I can't find how to use. There doesn't seem to be any information on how to inject into managers, although there's a few for using dagger.