- Home /
Disable permission dialog in Unity 5
Hi all,
Unity 5.3.2p2 came with the following change:
Android: Marshmallow - Added the possibility to disable the permission dialog by adding metadata to the activity.
What metadata needs to be added? The change doesn't reference a bug number. We have our own system in place to ask for the required permissions so we don't need them all up front.
Thanks in advance,
Stockx
Hello, what does it mean exactly ? To disable the permission popup at the start and ask the permission later ?
Yes.
Unity 5 asks for all required permissions up front. If you want to do a flow seperately (show nice screens explaining why you are going to ask for certain permissions for example), you'd want to disable this and do it manually.
Answer by Stockx · Mar 14, 2016 at 04:30 PM
Apparently you need to add the following to your manifest file:
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
Thanks you, exactly what need! It's works like a charm. I set this metadata in the LAUNCHER Activity
We are using Unity 5.3.3p2, the meta-data should be added inside Application ins$$anonymous$$d.
Hi! I know I'm late, but is this allowed by the Android guidelines? It's a pretty convenient trick, but I doubt it's allowed by Google's transparency policies.
Also, I tried adding this line to the manifest and didn't work.
FYI it works in 2017.3 by putting that line in the application section. This became an issue for us because Google now requires that we target Android 8.0 (API level 26) to submit apps to the play store, and for all updates as of November 1, 2018. So that means apps that target 5.1, before the new permission system went into effect, will now have to adapt.
Answer by awais503 · Apr 06, 2019 at 12:30 PM
@Stockx Not working. Help me please.
Here's an example using the Camera. Obviously, make sure you change the package to yours. I'm using Android Native Goodies Pro to do the runtime permission request when the user tries to use the camera.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.allprocorp.app" android:versionCode="38" android:versionName="1.4" android:installLocation="preferExternal">
<uses-sdk android:$$anonymous$$SdkVersion="19" android:targetSdkVersion="28" />
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@style/UnityThemeSelector" android:isGame="true" android:banner="@drawable/app_banner">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:launch$$anonymous$$ode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|ui$$anonymous$$ode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">
<intent-filter>
<action android:name="android.intent.action.$$anonymous$$AIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBAC$$anonymous$$_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="unity.build-id" android:value="aaec6a9f-4d0c-4c41-9038-fb6cbe6acaad" />
<meta-data android:name="unity.splash-mode" android:value="2" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="android.max_aspect" android:value="2.1" />
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CA$$anonymous$$ERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.mul$$anonymous$$ch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.mul$$anonymous$$ch.distinct" android:required="false" />
</manifest>
Your answer
Follow this Question
Related Questions
[Android] Remove READ_PHONE_STATE and READ_EXTERNAL_STORAGE permissions 2 Answers
Avoid android permission prompt when returning to app after changing settings on device? 0 Answers
AndroidManifest.xml: meta-data unityplayer.UnityActivity 2 Answers
How can I replace correctly the main activity on the Android Manifest? 0 Answers
does unity 5.3 android sms billing status require configuration changes ? 0 Answers