androidunity-game-enginevirtual-realitysamsung-gear

Application froze when system popup show Unity3D Samsung Gear VR Bluetooth Android


I am developing an Android application using Unity3D for the Samsung Gear VR, with the Samsung Galaxy S7.

In my app, I use the bluetooth to create a local network between two devices. When the system popup asking permissions to enable bluetooth discoverability is supposed to appear in my app, the whole app freeze, the popup is not shown and I have to reboot the phone to use it again.

Is there a solution to maybe ask for that permission before my app is launch? For example, another request, regarding the access to local file system is asked before the splash screen of my app, but I don't know why and how this permission is asked at this time.

Thanks in advance,


Solution

  • This is a bug that is now fixed in Unity 5.4.0B15.

    Unity 5.4.0B15 Android Marshmallow - Fixed issues when querying for custom permissions.

    Update to 5.4.0B15 to fix this problem.

    Notice:

    In Android 6.0 Marshmallow, Android permission is now asked when during run-time instead of install time. There is nothing you can do about that.

    The first time permission is asked, you get something like this

    enter image description here

    The second time, the player will have a chance to choose Never ask again.

    enter image description here

    The reason for this is to give the user complete control of which permission to allow and which ones to decline. For example, you can allow WiFi but reject Bluetooth unlike before, when you had to either allow every permission or reject all of them.