Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get latest location from fun getCurrentLocation(context: Context,onResult: (LocusResult) -> Unit) #85

Open
mary-ng5519 opened this issue May 30, 2023 · 0 comments

Comments

@mary-ng5519
Copy link

mary-ng5519 commented May 30, 2023

the API doesnt support for threadings from androidx.work, we tried async{}, runBlocking{} but it doest help, the API runs async in the underlying thread
Cannot get latest location from fun getCurrentLocation(context: Context,onResult: (LocusResult) -> Unit)

class MyWorker(mContext: Context, workerParameters: WorkerParameters) :
    Worker(mContext, workerParameters) {
  override fun doWork(): Result {
Locus.getCurrentLocation(applicationContext) { result ->
                    result.location!!.let {
//none of values retrived
}
}
  }
}

Please help support API return in future/promises

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant