cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Get User Name (App Lab)

ForemanDev
Expert Protege

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?

1 ACCEPTED SOLUTION

Accepted Solutions

ForemanDev
Expert Protege

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/...

View solution in original post

6 REPLIES 6

ForemanDev
Expert Protege

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/...

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?

jboss
Protege

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.

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

 

Did your issue ever get solved? I've been waiting for over a week at this point and I'm unsure if there's something I should be doing or if this is normal.

 

Update: I found out through support that your DUC requests are reviewed at the same time as an app submission so it won't go through unless you submit your app for review. Once I did that, it took me about 3 weeks for the review process to go through and for me to be given access.

 

New issue though: in the editor I can get the player names but when I build the game and put it on my Quest it's coming back as null. Anyone else have to deal with that?

It works for me after DUC. One more thing, even for test user, if we don't enable data use with DUC, we still can't get the user name after deploying into Quest device. Although the user name can be retrieved in Unity editor, and also the official Oculus document says that "Test user accounts are exempt from DUC requirements. When you use test users to make API calls to Oculus Platform features, the features return valid data even if your app has not been approved for those features.https://developer.oculus.com/resources/publish-data-use/#how-to-develop-apps-while-waiting-for-duc-a... 

The codes for retriving user name in both Quest2 device and Unity Editor:

 

    private void OnLoggedInUserCallback(Message<User> msg)
    {
        if (msg.IsError)
        {
            Debug.LogErrorFormat("Oculus: Error getting logged in user. Error Message: {0}",
                msg.GetError().Message);
        }
        else
        {
            oculusId = msg.Data.ID.ToString(); // do not use msg.Data.OculusID;
            oculusDisplayName = string.IsNullOrEmpty(msg.Data.DisplayName) ? msg.Data.OculusID  : msg.Data.DisplayName; // oculus user display name
            
            GetUserProof();
        }
    }