tbruyelle / RxPermissions

Android runtime permissions powered by RxJava2
Apache License 2.0
10.49k stars 1.31k forks source link

compileSdk 33,pixel 手机android 13,请求权限失败 #364

Closed xuexirong closed 9 months ago

xuexirong commented 1 year ago

android 13 的小米手机没问题

tzutalin commented 1 year ago

having the same issue. unable to work for compileSdkVersion = 33

hkercn commented 1 year ago

弃用吧,部分海外13版本手机,权限请求结果都是false 2023-06-30 11:57:53,176 - requestSinglePermission-2 isHandle:false,granted:false,name:android.permission.READ_EXTERNAL_STORAGE,shouldShowRequestPermissionRationale:false 2023-06-30 11:57:53,215 - requestSinglePermission-2 isHandle:true,granted:false,name:android.permission.WRITE_EXTERNAL_STORAGE,shouldShowRequestPermissionRationale:false 2023-06-30 11:59:25,713 - initAllMusicList localMusicList.empty:true 2023-06-30 11:59:30,678 - requestSinglePermission-1 isHandle:false,granted:true,name:android.permission.RECORD_AUDIO,shouldShowRequestPermissionRationale:false 2023-06-30 11:59:30,680 - requestSinglePermission-1 isHandle:true,granted:true,name:android.permission.MODIFY_AUDIO_SETTINGS,shouldShowRequestPermissionRationale:false 2023-06-30 11:59:30,680 - requestSinglePermission-1 isHandle:true,granted:true,name:android.permission.READ_PHONE_STATE,shouldShowRequestPermissionRationale:false 2023-06-30 11:59:35,214 - requestPermissionsSingleRequest-1 hasHandler:false,granted:false,name:android.permission.READ_EXTERNAL_STORAGE,shouldShowRequestPermissionRationale:false 2023-06-30 11:59:35,246 - requestPermissionsSingleRequest-1 hasHandler:false,granted:true,name:android.permission.READ_MEDIA_AUDIO,shouldShowRequestPermissionRationale:false 2023-06-30 12:00:17,783 - requestPermissionsSingleRequest-1 hasHandler:false,granted:false,name:android.permission.READ_EXTERNAL_STORAGE,shouldShowRequestPermissionRationale:false 2023-06-30 12:00:17,808 - requestPermissionsSingleRequest-1 hasHandler:false,granted:false,name:android.permission.WRITE_EXTERNAL_STORAGE,shouldShowRequestPermissionRationale:false 2023-06-30 12:00:17,836 - requestPermissionsSingleRequest-1 hasHandler:false,granted:true,name:android.permission.READ_MEDIA_IMAGES,shouldShowRequestPermissionRationale:false

不论用户是否真正授予了权限!

xuexirong commented 1 year ago

@hkercn 有推荐的么

EigenIsCoding commented 1 year ago

当 targetSDK = 33 , READ_EXTERNAL_STORAGE 就无效了,申请时需要动态替换成细化后的权限,并且在manifest里面也要更新,测试是可以的

chinalwb commented 9 months ago

当 targetSDK = 33 , READ_EXTERNAL_STORAGE 就无效了,申请时需要动态替换成细化后的权限,并且在manifest里面也要更新,测试是可以的

Tested and confirmed it works as described. Specifically, if I request Manifest.permission.READ_MEDIA_IMAGES like this:

rxPermissions.requestEachCombined(Manifest.permission.READ_MEDIA_IMAGES)
    .subscribe(permission -> {
       Log.d("xx", "permission granted? " + permission.granted); // prints true if I tap on Allow
    })

However, if I request like this (appending WRITE_EXTERNAL_STORAGE):

rxPermissions.requestEachCombined(Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.WRITE_EXTERNAL_STORAGE)

I tapped Allow but still, I got permission.granted == false.

I think this is also compliance with @hkercn 's comment.

KarlLargerFeld commented 9 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

xuexirong commented 9 months ago

@KarlLargerFeld rxPermissions.requestEachCombined(Manifest.permission.READ_MEDIA_IMAGES) .subscribe(permission -> { Log.d("xx", "permission granted? " + permission.granted); // prints true if I tap on Allow }) 这个方案是可以的,问题已经得到解决,这个问题我关了