Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ivan_santiago_h's avatar
9 years ago

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.

4 Replies

Replies have been turned off for this discussion
  • 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.
  • 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.
  • 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.
  • Thanks for the answer. I thought that I could take that information from the Unity Utilities.
    I will download the PlatformSDK.