guolindev / PermissionX

An open source Android library that makes handling runtime permissions extremely easy.
Apache License 2.0
3.34k stars 386 forks source link

scope.showRequestReasonDialog弹窗没展示 #260

Open nangongkuo opened 8 months ago

nangongkuo commented 8 months ago

PermissionX.init(activity) .permissions(PermissionX.permission.POST_NOTIFICATIONS) .onExplainRequestReason { scope, deniedList -> val message = "PermissionX需要您同意以下权限才能正常使用" scope.showRequestReasonDialog(deniedList, message, "Allow", "Deny") } .request { allGranted, grantedList, deniedList -> if (allGranted) { Toast.makeText(activity, "所有申请的权限都已通过", Toast.LENGTH_SHORT).show() } else { Toast.makeText(activity, "您拒绝了如下权限:$deniedList", Toast.LENGTH_SHORT).show() } }

val message = "PermissionX需要您同意以下权限才能正常使用" scope.showRequestReasonDialog(deniedList, message, "Allow", "Deny") 弹窗没有展示,直接展示了系统的权限申请弹窗,这是为什么?我是按照你文档里说的用的

guairongyi commented 4 months ago

我也遇到这个问题了,你解决了吗