Android 运行时棉花糖权限

Android Runtime Marshmallow Permission

Google 在 运行 时允许权限,它允许用户允许或拒绝权限。

当用户安装应用程序时,权限应自动打开,不应询问用户。

如何获得此功能?

谢谢。

这是不可能的。如果用户不允许权限,则应用程序无法访问与特定权限相关的资源。出于安全目的,由 google 完成。

不可能在 marsh mallow 上这样做,因为它完全基于 运行时间 permissions.It 增加用户 security.Your 查询仅支持以下版本 [=14] =] 目标版本为 22 并且 运行 您的应用。

When user installs the app the permissions should automatically be ON, it should not be asked to user.

targetSdkVersion 低于 23。这不是一个可行的长期解决方案,因为最终 某事 会迫使您的手牌 targetSdkVersion 23 或更高。

您引用 OlaCabs 作为您想要的行为的示例。 OlaCabs 的 targetSdkVersion 为 22。

How can I set default permission in marshmallow so that if user sets off the permission manually and again when user opens the app the permission should be ON and the permissions should not be ask to user, it should be directly ON.

那是不可能的。例如,对于 OlaCabs,在安装它之后 运行 之前,我撤销了它访问联系人、位置、phone、SMS 和存储的权利。然后我 运行 OlaCabs,它崩溃了,因为我已经撤销了它对位置数据的访问权限,而 OlaCabs 的作者没有先检查他们是否有权限。 OlaCabs 不会神奇地导致这些权限被重新 g运行ted。