New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

[Announcement] "Dangerous Permission Error" in Unity Mobile Applications Fix

imperativityimperativity Posts: 3,465 Oculus Staff

Our QA group has flagged a number of Unity-based apps as having a "dangerous permission" because they require a microphone. This is a confusing report for folks that don't intend to use a mic.

What's happening: in Unity, our Platform SDK (required to implement the entitlement check) also includes code for VOIP. Unity auto-adds the microphone permission to your Android Manifest at build time if it sees any code references to the Microphone class. The Platform SDK code contains such references, so the permission is added even if you do not use VOIP or any other mic function.

How to fix it: Find OculusPlatform/Scripts/MicrophoneInput.cs and remove all references to the Microphone class. In the latest version of the Platform SDK, there are two: line 18 and line 33. These lines can be commented out and replaced with microphoneClip = null; and int pos = 0; respectively.

Once references to the microphone class have been removed, Unity should stop inserting the microphone permission. Of course, using the above hack will break mic support. If you need mic support later, remember to go back and undo this change, or switch to the (superior) MicrophoneInputNative implementation.

To test this fix, uninstall your app and reinstall it fresh. Make sure you do not use the -g option when you do the install. Upon opening the app you should not see a prompt to accept the microphone permission. If the app opens with no prompt, everything is good.

Please tag me @imperativity in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

Having an issue with our platform, services, or integrations?

Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.
Sign In or Register to comment.