Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Best Way to Request Geolocation Permissions in Unity3D C# Behavior

Hello everyone,

I was wondering if somebody could provide me with a sample with the best method to request geolocation permissions from a user on the Microsoft HoloLens. I used the sample Unity3D geolocation code they provide for Location Services. When I trigger the "Start()" it does prompt the user, but never saves the preferences to the Settings > Privacy. I usually have to go back in and check my app to allow Geolocation and then it begins to work. Even with pressing "Yes" to allow it does not save in the emulator environment for the next app launch when keeping the emulator open (with the same emulator session).

Thanks
Chris Zenzel

Christopher Zenzel

Shaping the Future by Being a Leader in Technology while Living with Autism (ASD). Looking for Opportunities in Magic.

https://chriszenzel.com
https://linkedin.com/in/chriszenzel

Best Answer

Answers

  • Options

    I found two issues:

    • The emulator is not providing correct permission grants after allowing the application using the interface. The device is performing correctly after permission is granted. (Seems the permissions are emulator problems).

    • After requesting the location, before using lastData from Unity, you must wait an additional 2 - 3 seconds using the "yield" before requesting any sensor data on the actual device.

    Christopher Zenzel

    Shaping the Future by Being a Leader in Technology while Living with Autism (ASD). Looking for Opportunities in Magic.

    https://chriszenzel.com
    https://linkedin.com/in/chriszenzel

  • Options

    @CZenzel do you have the Location capability checked in Unity under the:
    Edit | Project Settings | Player | INSPECTOR | Publishing Settings | Capabalities

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

Sign In or Register to comment.