Closed askona closed 7 months ago
I see the problem here: ACCESS_BACKGROUND_LOCATION
was added in API 29 but this is assuming it was added in API 33.
I should be able to make use of the min/max SDK definitions I added in a previous commit to resolve this.
I'm requesting when_in_use permission, and then, if it's granted, requesting always. The issue is that on Android lower then 13 always is not being requested, and I found why. JS:
this.diagnostic.requestLocationAuthorization('**when_in_use**') // first dialog - is being showed up .then((status) => { return this.diagnostic.requestLocationAuthorization('**always**'); // this dialog is NOT showing on Android < 13 });
This is why it doesn't show second - it assumes _ACCESS_BACKGROUNDLOCATION is already granted. But as result - user still have "when_in_use" permission level. If I remove that line:
permission.equals("ACCESS_BACKGROUND_LOCATION"),
I'll be able to see both dialogs - request for when_in_use and for always