PermissionsDispatcher
PermissionsDispatcher copied to clipboard
Android 11 runtime permission authorization popup does not pop up
FAQs
Overview
- Describe the issue briefly
Expected
- What is the expected behavior?
Actual
- What is the actual behavior?
Environment
- Which library version are you using?
- On which devices do you observe the issue?
- Note any other information that might be useful
Reproducible steps
- While it's not required, it'd be perfect to add a link to a sample project where you encounter the issue
Sorry we were focusing on maven central migration, would you mind elaborate on the issue?
I am also facing the same issue i.e. Android 11 runtime permission authorization popup not coming. We updated the to version 4.8.0 also.
@misbahazmi are you using ktx or a normal one?
trying to repro the issue with sample
and ktx-sample
but haven't been able to 🤔
@hotchemi - I am using normal one. I will try to reproduce the same. Thanks
any update here?
~I'm having the same issue. The location request does not appear on screen.~
Can anyone give us an example(wondering this is not the library-specific issue)? 👀
@hotchemi not really sure whether others stuck in the same issue, but I am facing the similiar issue when I request the Location permissions(ACCESS_BACKGROUND_LOCATION
).(I'm using ktx library.)
Ok I think I've repro my issue in the ktx-sample
project, just change COMPILE_SDK_VERSION
and TARGET_SDK_VERSION
to 30 then request all of the Location permissions, and I think this is because of the latest limit for Location background permission.
According to the doc, the system enforces us to request ACCESS_BACKGROUND_LOCATION
after granted the foreground Locations, otherwise the request dialog will not appear.
I've granted the ACCESS_BACKGROUND_LOCATION
successfully by 2-step requests:
private lateinit var locationRequest: PermissionsRequester
private lateinit var backgroundLocationRequest: PermissionsRequester
override fun onAttach(context: Context?) {
locationRequest = constructLocationPermissionRequest(
LocationPermission.COARSE, LocationPermission.FINE,
onShowRationale = ::onLocationShowRationale,
onPermissionDenied = ::onLocationDenied,
onNeverAskAgain = ::onLocationNeverAskAgain
) {
backgroundLocationRequest.launch()
}
backgroundLocationRequest = constructLocationPermissionRequest(
LocationPermission.BACKGROUND,
onShowRationale = ::onLocationShowRationale,
onPermissionDenied = ::onLocationDenied,
onNeverAskAgain = ::onLocationNeverAskAgain
) {
Toast.makeText(requireActivity(), "Enable location!", Toast.LENGTH_SHORT).show()
}
}
// locationRequest.launch()
Turns out the dialog for the permissions didn't show up because I never requested them. My stupid ass thought the constructLocationPermissionRequest automatically added the location permissions for me, which I see now that it don't. Strike me from "having this issue" list.
Is there any update or workaround for this? Blocks me to upgrade android version
oh sorry didn't notice the update, let us check
@hotchemi Is there any update or workaround?
Now considering what to do here. The quick workaround should be https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/707#issuecomment-809973388 ?
Right now I'm thinking of creating one more pattern of PermissionRequestFragment
and request the background permission, or having a lint to prevent the mistake from happening.