Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Stockx · Mar 09, 2016 at 12:21 PM · androidmanifestpermissionsmetadataactivity

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

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Andrey-Postelzhuk · Mar 14, 2016 at 04:28 PM 0
Share

Did you find a solution?

avatar image Kashran · Mar 15, 2016 at 09:54 AM 0
Share

Hello, what does it mean exactly ? To disable the permission popup at the start and ask the permission later ?

avatar image Stockx Kashran · Mar 15, 2016 at 09:56 AM 1
Share

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.

avatar image Kashran Stockx · Mar 15, 2016 at 10:14 AM 0
Share

Ok thanks for your answer!

2 Replies

· Add your reply
  • Sort: 
avatar image
6
Best Answer

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" />
Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ZeroKcm · Mar 19, 2016 at 08:56 PM 0
Share

Thanks you, exactly what need! It's works like a charm. I set this metadata in the LAUNCHER Activity

avatar image Andy Lee ZeroKcm · Apr 15, 2016 at 10:00 AM 0
Share

We are using Unity 5.3.3p2, the meta-data should be added inside Application ins$$anonymous$$d.

avatar image laurG · Oct 23, 2017 at 09:15 PM 1
Share

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.

avatar image BjoUnity3d · Oct 23, 2018 at 11:12 PM 0
Share

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.

avatar image
0

Answer by awais503 · Apr 06, 2019 at 12:30 PM

@Stockx Not working. Help me please.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BjoUnity3d · Apr 06, 2019 at 01:42 PM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

63 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges