Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onExplainReason 方法不执行 #284

Open
baoer opened this issue Aug 2, 2024 · 1 comment
Open

onExplainReason 方法不执行 #284

baoer opened this issue Aug 2, 2024 · 1 comment

Comments

@baoer
Copy link

baoer commented Aug 2, 2024

PermissionX.init(this).permissions(requestList).onExplainRequestReason(new ExplainReasonCallback() {
@OverRide
public void onExplainReason(@nonnull ExplainScope scope, @nonnull List deniedList) {
LogUtil.w("userinfo", "----- 申请权限");
scope.showRequestReasonDialog(deniedList, "需要同意以下权限才可以使用", "同意", "拒绝");
}
}).request(new RequestCallback() {
@OverRide
public void onResult(boolean allGranted, @nonnull List grantedList, @nonnull List deniedList) {
if (allGranted) {
// openAblum();
}
}
});

上面的代码,showRequestReasonDialog 弹窗不执行,然后直接就弹窗系统的申请权限了,请问怎么弄呢? 华为mate40 pro手机,鸿蒙系统

@boboqun
Copy link

boboqun commented Nov 6, 2024

这个是首次拒绝以后才显示的。想要先显示后申请,可以使用.explainReasonBeforeRequest()方法,readme里有

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants