Search Unity

Android permissions don't show with Cardboard SDK

Discussion in 'AR/VR (XR) Discussion' started by danielesuppo, Sep 16, 2017.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello all!
    I have a Unity app with some user permissions on Manifest.
    When I install it on my mobile I'm regularly asked to grant these permissions.
    But if I use Cardboard VR SDK (Virtual reality supported enabled --- Virtual Reality SDKs: Cardboard) I'm no longer asked for them.
    Do you know why?
    Many thanks!
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Permissions dialogs are suppressed in Google VR (Cardboard, Daydream) as they break the whole experience of VR for the user. Having these pop up while you are in a VR experience would be jarring and upset the user and the experience.
     
  3. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Thank-you joejo, so the permissions are always granted I suppose..?
    Probably it's off-topic, but I'm asking that because I have a BLE plugin that work very well, except when I use the Cardboard SDK (does not work anymore), and I really don't understand the relationship between them
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I believe so, yes.
     
  5. mark-007

    mark-007

    Joined:
    Mar 4, 2015
    Posts:
    27
    I had the issue that although Unity (as I understand it) will enable network access on android if it sees any code that needs it, in my case my network code was within a plugin and Unity didn't automatically see it / ensure the app had network access as a result.. as soon as I changed the "Internet Access" in Player Settings > Other Settings to "Require" I had internet & network access in my Cardboard project.

    I'm not sure if this will help for you Bluetooth plugin but thought I'd reply just in case. I was certainly pulling my hair out with it.
     
  6. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Thank-you joejo and mark-007,
    I've just discovered that all my troubles where just because the Manifest of GVR do not show any permission request, and consequently all the permissions in the Manifest of my plugin are DISABLED!
    I had to manually enable them from mobile side, and now everything work fine (to be more precise my main permission that gave me a lot of troubles is "ACCESS COARSE LOCATION").
    So, unfortunately, joejo it seem that you are wrong... or maybe I'm missing something?

    I've highlighted these lines in the final Manifest of my apk:

    <meta-data
    android:name="unityplayer.SkipPermissionsDialog"
    android:value="true" />

    that seem to be responsibles of not to show permission request at the very first start up of the application (and so to grant any permission), can I simply delete them so to have a working Apk without to have to manually activate permissions on any device?
    Many thanks!
     
    nomanhussain037 likes this.
  7. NCartist

    NCartist

    Joined:
    Nov 3, 2013
    Posts:
    15
    SOLUTION:
    I was able to solve this issue by modifying the final Android Manifest file by changing the "true" to "false" in this line of code

    <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />

    In order to modify the final Android Manifest file, you are supposed to move a copy of it into the Unity environment, like this video shows, and not modify it in the temp folder directly.
     
    Last edited: Feb 22, 2018
    Ruben_Visyon and nomanhussain037 like this.
  8. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I am unsure that you can remove that and have the app still pass Play Store submission. That manifest entry is a hard requirement on our end when GoogleVR (Cardboard and Daydream) is enabled.

    Unfortunately this isn't a Unity issue as much as it is an Android/Google issue. Has anyone reported to or checked the Google VR public GitHUB site?

    There may also be pointers or clarity with the PermissionsDemo in the Google VR SDK for Unity around handling permissions in VR? It looks like there is some help there for handling permissions in VR.
     
  9. rinkusaru

    rinkusaru

    Joined:
    Sep 7, 2017
    Posts:
    14
    I'm facing here the same issue I'm using the cardboard sdk in my application and even though in the start I've not enable the cardboard mode still the location pop up is not enabled and I've to manually enable the location from the appication permission info.
    Is there any fix for this.
     
  10. rrrus

    rrrus

    Official Google Employee

    Joined:
    Jul 13, 2015
    Posts:
    14
    The PermissionsDemo scene in the GVR SDK for Unity demonstrates how to leave VR to get the Android permissions request dialogs to show properly, then return to VR.
     
    mark-007 likes this.