Closed rmtheis closed 7 years ago
Hey @rmtheis ,
You don't need to ask for permission before calling locationManager.get()
since you define PermissionConfiguration
in your builder, library will handle that parr too. Just remove the part you ask for permission manually, and library will call onPermissionGranted
first time user grants as well.
Hmm...I'm not sure what you mean. I'm not asking for permission manually, I just see the permission prompt the first time that I call to locationManager.get()
. It's at that point that I'm expecting onPermissionGranted()
to be called, but I'm not seeing that happen.
Ahhh, sorry misunderstand the problem.
I just saw your sample code, it is because you are not extending LocationBaseActivity nor calling the required methods. So that library cannot work properly and retrieve or pass back the related information.
This library requires quite a lot of lifecycle information to handle all the steps between onCreate - onResume - onPause - onDestroy - onActivityResult - onRequestPermissionsResult.
Please read the README file for further information.
Thank you! Not sure how I overlooked that.
First off, this project is excellent! It has saved me a ton of time, so thank you for that.
I'm having an issue with
onPermissionGranted
not being called when I choose "Allow" in the permission dialog.onPermissionGranted
is called the second time I calllocationManager.get()
, but that method is not called the first time I call locationManager.get(), when the user taps "Allow" on the dialog.Does this look like a bug to you, or am I doing something wrong?
I'm using version 2.0.3.
The complete code is here: https://github.com/rmtheis/LocationManagerTestApp
Configuration
Logs