Skip to main content
RaptorMatt
Inspiring
March 1, 2021
Solved

Can't Get User Name (App Lab)

I am developing an Oculus Quest app for release on the App Lab. Previously, I was able to get the player's user name just fine via

 

Oculus.Platform.Users.GetLoggedInUser().OnComplete(getLoggedInUserComplete);

 

but recently that stopped working and now the user name is just an empty/null string. Essentially, I can't display a user name above players' heads anymore.

 

Below is the code I am using to retrieve the user name:

 

void getLoggedInUserComplete(Message msg)
        {
            if (msg.IsError)
            {
                Debug.LogError("Could not get Oculus user name!");
            }
            else
            {
                Debug.Log("GetLoggedInUser success! " + msg + "; message type: " + msg.Type);
                if (msg.Type == Message.MessageType.User_GetLoggedInUser)
                {
                    Debug.Log("Oculus GetLoggedInUser success! Setting user name in game manager: " + msg.GetUser().OculusID);
                    GameManager.Instance.SetUserName(msg.GetUser().OculusID);

                    Debug.Log(msg.GetUser().DisplayName);
                    Debug.Log(msg.GetUser().ID);
                    Debug.Log(msg.GetUser().OculusID);
                    Debug.Log(msg.GetUser().ToString());
               

 

 

GetLoggedInUser is successful, however the message that gets returned is empty. Here is what prints out into the debug log from the above code:

 

Oculus Platform entitlement check passed!
GetLoggedInUser success! Oculus.Platform.MessageWithUser: message type: User_GetLoggedInUser
Oculus GetLoggedInUser success! Setting user name in game manager: 

0

Oculus.Platform.Models.User

 

 

As you can see, all of the information returned in the GetLoggedInUser message is empty. My app key is correct, the entitlement check passes, and it successfully gets the logged in user but with an empty return message. It did not used to be this way but recently it broke (without me changing any of the code). I'm stumped. How can this be fixed?

RaptorMatt
Inspiring
March 6, 2021

My issue was fixed by filling out and submitting the "Data Use Checkup" in the developer dashboard. The approval for this was instant - there doesn't seem to be an actual review process. I also requested access to every API feature in the list.

 

After doing so, the API features in my app began working again. I don't know why they worked before if this was a required step. Perhaps Oculus made a change, but didn't tell anyone.

 

I found the original answer to the problem here: https://forums.oculusvr.com/t5/Unreal-Development/Get-Oculus-Identity-returns-No-Logged-In-user/m-p/853430#M6278

7 replies

RaptorMatt
RaptorMattAuthorAnswer
Inspiring
March 6, 2021

My issue was fixed by filling out and submitting the "Data Use Checkup" in the developer dashboard. The approval for this was instant - there doesn't seem to be an actual review process. I also requested access to every API feature in the list.

 

After doing so, the API features in my app began working again. I don't know why they worked before if this was a required step. Perhaps Oculus made a change, but didn't tell anyone.

 

I found the original answer to the problem here: https://forums.oculusvr.com/t5/Unreal-Development/Get-Oculus-Identity-returns-No-Logged-In-user/m-p/853430#M6278

Participant
April 11, 2021

Hm, I have the same issue, but for me the data-use checkup seems to be taking a long time, I am already waiting for 3 weeks and it still says it is "in review" - is anybody having the same issue with the data checkup?

New Participant
January 17, 2022

Were you ever approved?  I am having the same issue.

 

Inspiring
May 27, 2021

Do I have to fill in this Data Use Checkup also for a simple test application that I just build and run from Unity?

 

Is there some documentation on this? When I test this in the editor I get a nullpointer exception on Oculus.Platform.Users.GetLoggedInUser().OnComplete(getLoggedInUserComplete);

And when I do build and run I get the same error in Android Logcat.

 

The Unity reference documentation (https://developer.oculus.com/reference/unity/latest/ ) no longer exists. And from the textual explanation (https://developer.oculus.com/documentation/unity/ps-presence/ ) I expected that Platform.Users.GetLoggedInUser() would simply return a User object, not that I had to use a callback and check a message.

 

I hope someone can point me in the right direction.