Skip to main content
Participant
August 4, 2016

Access to Profile's Username

Hi there. 
I am trying to access to the username of the user's profile, through OVRManager.profile.userName but it keeps returning an empty string. 
Does or did anyone else have this issue? Do you know any other way to access to that information?

Many thanks in advance.
This topic has been closed for replies.

4 replies

Inspiring
August 4, 2016
Let me see if someone here knows about this. Also, this should be in the Developer section of the forum. You can switch sections by clicking the drop-down menu on the top right.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
Participant
August 5, 2016
Ok, i got it work, was a different thing. But now, all I get is "Oculus User", not the proper username.
Thanks for your answer. 
I will change the section right away.
Inspiring
August 5, 2016
You can definitely retrieve it through the PlatformSDK through this call:

using Oculus.Platform;
using Oculus.Platform.Models;
Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);

And the callback would look something like:

private void GetLoggedInUserCallback(Message msg) {
   if (!msg.IsError) {
      User u = msg.GetUser();
      mOculusUserHandle = u.OculusID;
   }
}


This works whether the user is online or offline.

Just an alternative approach if you think you'll ever want to add other Oculus platform functionality to your game/app in the future anyway.
Participant
August 9, 2016
Thanks for the answer. I thought that I could take that information from the Unity Utilities.
I will download the PlatformSDK.