Open jackyhieu1211-hn opened 3 years ago
@hotchemi Please check.thank you very much
Thx for the report, we should address this issue before Android 12. Just in case which module are you using right now?
@hotchemi
I made a temporary fix as follows
@OnPermissionDenied(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
fun getLocationDenied() {
checkAccessCoarseLocation()
}
@OnNeverAskAgain(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
fun onNeverAskLocationAgain() {
checkAccessCoarseLocation()
}
private fun checkAccessCoarseLocation() {
if (context?.isAccessCoarseLocationGranted() == true) {
getLocation()
} else {
Log.e("Error", "Permission")
}
}
fun Context.isAccessCoarseLocationGranted(): Boolean {
if (isAndroidS().not()) return false
return PermissionUtils.hasSelfPermissions(this, Manifest.permission.ACCESS_COARSE_LOCATION)
}
fun isAndroidS(): Boolean {
return Build.VERSION.SDK_INT >= 31
}
@hotchemi Is this sorted ?? From this month all app updates should target API 31 or above.
Location permission android 12
-- Hello admin. I checking android 12 and have a problem: In android 12. App must request both permission ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION
My code:
When I choose option Approximate -> While using the app
Actual results: OnPermissionDenied called. Expected results : getLocation() will call
=> Reason: method verifyPermissions in class PermissionUtils checking.
Please help me.