-
Notifications
You must be signed in to change notification settings - Fork 670
Application stuck when requesting ACCESS_BACKGROUND_LOCATION #240
Comments
I have the same problem. Is there any solution? |
Hi @choryuidentify @AlexDundar I've been testing the issue you reported and it's not related to Dexter but the way you ask for the permission. When using the background location permission you have to request the fine location or coarse location permission too. However, your code is only requesting the background ones. If you use this code you'll see how the app is working now: Dexter.withActivity(this)
.withPermissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION)
.withListener(object : MultiplePermissionsListener {
override fun onPermissionsChecked(report: MultiplePermissionsReport?) {
}
override fun onPermissionRationaleShouldBeShown(
permissions: MutableList<PermissionRequest>?,
token: PermissionToken?
) {
token?.continuePermissionRequest()
}
}).check() Remember to declare these permissions in the manifest. Here you can find two useful resources related to this topic: I hope this answers your question. I'm closing the issue for now. However, feel free to open it again if you think Dexter is not able to handle this permission properly. |
on api 30 it doesn't work. |
it works on API 29, but doesn't work on API 30 |
Expected behaviour
Show permission is granted or not granted
Actual behaviour
Stuck on there
tested on Android Q Emulator
Steps to reproduce
Permission -> Location -> Choose 'Allow only while using app'
then, write code
and run, choose 'Keep while-in-use access' or 'Keep and don't ask again', It stuck.
If choose 'Allow all time', It stuck too but restart app, it will execute onPermissionGranted block
Version of the library
6.0.0
The text was updated successfully, but these errors were encountered: