如何在不提示用户的情况下将运行时权限授予android应用程序 [英] How to grant runtime permissions to an android application without prompting the user

查看:125
本文介绍了如何在不提示用户的情况下将运行时权限授予android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个Android应用程序,当通过Google Playstore安装该应用程序时,应在不询问用户的情况下访问SMS访问,联系人,位置服务等运行时权限.

我知道这是有可能的,因为我已经看到它发生在Playstore上的一些Android应用程序中,例如 柯达811 App 渣打银行应用程序

有人知道即使在手机运行Android Nougat的情况下也可以做到这一点.

解决方案

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

AFAIK (不可能)

请阅读运行时权限

我正在尝试构建一个Android应用程序,当通过Google Playstore安装该应用程序时,应在不询问用户的情况下访问SMS访问,联系人,位置服务等运行时权限.

比您必须使targetSdkVersion低于23

有人知道即使在手机运行Android Nougat的情况下也可以做到这一点.

这是不可能的,如果用户手动撤消危险许可,您的应用将崩溃

targetSdkVersion设置为23以下的缺点是什么

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

编辑 您将无法发货从2018年晚些时候开始在Play商店上更新您的应用

满足Google Play的目标API级别要求

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.

I know it is possible since I have seen it happen in a couple of Android Applications on Playstore like Kotak 811 App Standard Chartered Banking App

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

解决方案

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

AFAIK it is not possible

Please read 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.

than you have to make targetSdkVersion lower than 23

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

That is not possible and if user manually revoke the dangerous permission you app will crash

What are the disadvantages of doing targetSdkVersion lower than 23

if user manually remove permission from your app than you app get crash in android api 23 and above

EDIT 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应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆