安装时不要求Android权限 [英] Android permissions not requested on installation

查看:67
本文介绍了安装时不要求Android权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里发表文章之前,我已经搜索过类似的问题,但找不到解决我问题的答案.我的manifest.xml文件似乎正确,我希望询问用户安装权限(不是运行时,它已经可以与我的代码一起使用).我不知道为什么我输入的参数不起作用:

I've searched for similar questions before posting here and I didn't find a answer solving my issue. My manifest.xml file seems correct, I'd like the user to be asked for permissions on installation (not runtime, it already works with my code). I don't know why the parameters I put doens't work:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:name="VILES" android:versionCode="1" android:versionName="0.0.1" package="fr.nc.delegue.referendum" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    <uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
    <uses-permission android:name="android.permission.RECEIVE_MMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.WRITE_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
</manifest>

我使用Cordova(和Quasar)来构建我的应用程序,该应用程序运行良好,但是仍然存在安装时未要求权限的问题...有人能告诉我我在做什么错吗?在此先感谢:)

I use Cordova (and Quasar) to build my app, the app is working great, but I still have this problem of permissions not being requested on installation... Can anyboy tell me what I'm doing wrong here? Thanks in advance :)

推荐答案

您没有做错任何事情,除了期待不再可用的东西. targetSdkVersion 23 或更高版本的应用完全可以在运行时权限下运行—无法强制Play商店或Android在安装时提示用户许可.而且您无法使用旧的 targetSdkVersion 来在Play商店(以及其他一些分发渠道)上分发应用.

You are not doing anything wrong, other than expecting something that is no longer available. Apps with a targetSdkVersion of 23 or higher operate purely off of runtime permissions — there is no way to force the Play Store or Android to prompt the user for permission at install time. And you cannot distribute your app on the Play Store (and on some other distribution channels) with that old of a targetSdkVersion.

这篇关于安装时不要求Android权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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