权限遭拒
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
大多数应用要求用户向其授予特定的应用权限才能正常运行。不过,在某些情况下,用户可能无法授予权限
- 他们认为应用的核心功能不需要权限。
- 他们不使用与权限相关的功能。
- 他们担心此权限会影响设备的性能。
- 他们就是感觉不自在,例如,他们对隐私权比较敏感。
使用 Android Vitals 来衡量用户的看法 {#:android-vitals}
Android Vitals 可以向您告知您的应用遇到权限遭拒的百分比,从而帮助您衡量用户的隐私权偏好设置和互动情况。通过 Play 管理中心,Android Vitals 会显示用户拒绝为您的应用授予权限的每日权限工作时段百分比。
如果您的应用在一天内向用户请求过至少一项权限,该日即计为一个权限申请日。当某个用户必须针对同一权限做出多项决定时,系统仅会记录工作时段结束时的最终决定。
Android Vitals 在权限组级别显示用户的决定。Android Vitals 还提供基准来帮助比较您的应用与同一 Play 商店类别中其他热门应用的差距。如需了解 Google Play 如何收集 Android Vitals 数据,请参阅 Play 管理中心文档。
最佳实践
拒绝率异常高意味着用户认为不值得通过进一步公开他们的信息来获得相应的好处。您可以通过多种方法让用户在使用您的应用时感到更加自在。如果您采取本部分中列出的步骤,您或许可以降低拒绝率。不过,您不应期望将拒绝率降到零,因为用户的个人偏好各不相同,有些人就是在任何情况下都不愿意授予权限。
避免请求不必要的权限
调查显示,用户更喜欢请求较少权限的应用。
将权限请求保持在必要的最少权限集有助于提高用户对应用的信任,并增加安装量。反之,添加不必要的权限请求可能会对应用在 Play 商店的曝光度产生负面影响。如果特定权限不是必要的,您或许可以通过其他方法减少应用的权限请求数量。应用权限最佳实践中介绍了一些常用方法。
在上下文中呈现权限请求
不太直观的非关键权限可能适合在上下文中进行说明。这样做可以让用户更加理解权限所带来的价值。图 1 显示了在上下文中为用户提供说明的示例。
图 1. 在上下文中说明权限请求
当应用在相关功能的上下文中请求权限时,用户可以更好地理解价值主张。增进理解可能有助于说服更多用户授予权限请求。
如需详细了解有关如何为用户提供说明和请求权限的实用指南,请参阅权限的 Material Design 模式。
说明您的应用为何需要获取权限
请考虑先在上下文中请求权限:为不太直观的权限提供说明有助于增进用户对权限的理解。如果用户先前拒绝了请求,shouldShowRequestPermissionRationale()
实用程序方法会返回 true。您的应用可以使用此方法确定何时显示说明。
如需详细了解如何呈现说明字符串,请参阅请求应用权限。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Permission Denials\n\nMost apps require that users grant them certain\n[app permissions](/guide/topics/permissions/overview) in order to function\nproperly. However, in some cases, users might not grant the permissions\n\n- They think the permission isn't needed for the app's core functionality.\n- They don't use the functionality associated with the permission.\n- They are concerned about the permission's impacting device performance.\n- They're simply uncomfortable, for example due to sensitivities regarding privacy.\n\nUse Android vitals to gauge user perceptions {#:android-vitals}\n---------------------------------------------------------------\n\nAndroid vitals can help you gauge your users' privacy preferences and engagement\nby informing you about the percentage of permission denials your app\nis receiving. Via the Play console, Android vitals shows the percentage\nof daily permission sessions during which users denied permissions for your app.\n\nA *daily permission session* refers to a day during which your app requested\nat least one permission from a user. When a given user has to make multiple\ndecisions for the same permission, only the final decision at the end of a\nsession is recorded.\n\nAndroid vitals shows you users' decisions at the permission-group\nlevel. Android vitals also provides benchmarks to help compare where your app\nstands with respect to other top apps in the same Play store category.\nFor information on how Google Play collects Android vitals data, see the\n[Play Console documentation](https://support.google.com/googleplay/android-developer/answer/7385505).\n\nBest practices\n--------------\n\nUnusually high denial rates suggest that users don't think the additional\nexposure of their information is worth the benefits offered in return.\nThere are a number of ways to make users feel more comfortable using your app.\nYou might be able to reduce the denial rate if you take\nsteps such as those outlined in this section. However, you shouldn't\nexpect to drive denial rates to zero, because users\nhave diverse personal preferences and some simply don't wish to grant\npermissions under any circumstances.\n\n### Avoid requesting unnecessary permissions\n\nResearch shows that users prefer apps that request fewer permissions.\nKeeping permission requests to the minimum set necessary can help improve user\ntrust in an app, and drive more installs. Conversely, adding unnecessary\npermission requests might negatively impact your app's visibility on the Play\nStore. If\nspecific permissions aren't necessary, you might be able to reduce your app's\nnumber of permission requests through alternative methods. Some common\napproaches are outlined in\n[App Permissions Best Practices](/training/permissions/usage-notes).\n\n### Surface the permission request in context\n\nNon-critical permissions that are less intuitive might benefit from being\nexplained in context. Doing so improves users' comprehension of the value\nderived from the permission. Figure 1 shows an example of educating a user\nin context.\n\n\n**Figure 1.**\nExplaining a permission request in context\n\n\u003cbr /\u003e\n\nUsers understand the value proposition better when the app requests the\npermission in the context of the related functionality.\nThis improved understanding might convince more users to grant permission\nrequests.\n\nFor more information about good guidelines about how to educate users and\nrequest permissions, see the\n[material design pattern for permissions](https://material.io/guidelines/patterns/permissions.html#permissions-denied-permissions).\n\n### Explain why your app needs the permission\n\nConsider starting by requesting your permission in-context: Providing an\nexplanation for less intuitive permissions helps to improve user comprehension\nof the permission. The\n[`shouldShowRequestPermissionRationale()`](/reference/androidx/core/app/ActivityCompat#shouldShowRequestPermissionRationale(android.app.Activity,%20java.lang.String))\nutility method returns true\nif the user has previously denied the request. Your app can use this method to\ndetermine when to show the explanation.\n\nYou can find more details about how to surface explanation strings in\n[Request App Permissions](/training/permissions/requesting)."]]