gpt4 book ai didi

android - 如何在不提示用户的情况下向 Android 应用程序授予运行时权限

转载 作者:行者123 更新时间:2023-11-29 14:29:59 24 4
gpt4 key购买 nike

我正在尝试构建一个 android 应用程序,当通过 Google Playstore 安装时,它应该有权访问运行时权限,如 SMS 访问、联系人、位置服务,而无需询问用户。

我知道这是可能的,因为我已经在 Playstore 上的几个 Android 应用程序中看到它发生了,比如柯达 811 应用程序渣打银行应用

有谁知道即使手机运行 Android Nougat 也能实现这一点。

最佳答案

How to grant runtime permissions to an android application without prompting the user

据我所知这是不可能的

请阅读 Run Time Permissions

I am trying to build an android application which when installed through Google Playstore should have access to the runtime permissions like SMS Access, Contacts, Location Service without asking the user for it.

你必须让 targetSdkVersion 低于 23

Does anyone know how this can be achieved even when the phone is running Android Nougat.

这是不可能的,如果用户手动撤销危险权限,您的应用程序将崩溃

What are the disadvantages of doing targetSdkVersion lower than 23

如果用户手动从您的应用中删除权限,那么您的应用会在 android api 23 及更高版本中崩溃

编辑<强> you will not be able to ship updates to your app on the Play Store starting later in 2018

Meet Google Play's target API level requirement

关于android - 如何在不提示用户的情况下向 Android 应用程序授予运行时权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48108381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com