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.
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.
Best Answer
-
CZenzel ✭
Hi @HoloSheep, Yes. I enabled "Location" under the Player settings. There seems to be an issue with the emulator not saving the actual "location permission." I also found that you have to allow 2 seconds before asking for "lastData" for correct location on both the emulator and device.
The Device does work with the normal workflow of asking for the permissions.
The next thing I am trying to figure out is that the location is way off when using an AT&T Hot Spot. I am using a NETGEAR one from them for some testing and found that it claims it is in Detroit. (I understand that it uses Geo-IP based information because the device does not have GPS).
I know some hotspots have a GPS over WiFi capability. Is there a library somewhere that can help with this? I would have to check my specific device if it has it built-in. I remember that some Verizon ones do have this feature.
Maybe Microsoft can integrate GPS over WiFi into HoloLens?
Christopher Zenzel
Shaping the Future by Being a Leader in Technology while Living with Autism (ASD). Looking for Opportunities in Magic.
5
Answers
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
@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
Hi @HoloSheep, Yes. I enabled "Location" under the Player settings. There seems to be an issue with the emulator not saving the actual "location permission." I also found that you have to allow 2 seconds before asking for "lastData" for correct location on both the emulator and device.
The Device does work with the normal workflow of asking for the permissions.
The next thing I am trying to figure out is that the location is way off when using an AT&T Hot Spot. I am using a NETGEAR one from them for some testing and found that it claims it is in Detroit. (I understand that it uses Geo-IP based information because the device does not have GPS).
I know some hotspots have a GPS over WiFi capability. Is there a library somewhere that can help with this? I would have to check my specific device if it has it built-in. I remember that some Verizon ones do have this feature.
Maybe Microsoft can integrate GPS over WiFi into HoloLens?
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