Skip to main content
JeffNik
Honored Contributor
November 28, 2020

Unity: GetLoggedInUser always returning Message.Data.ID = 0

  • November 28, 2020
  • 6 replies
  • 5743 views
In my Unity app (from within the editor), I'm trying to load my customized avatar for my main Oculus account. After I get a successful user entitlement check, I call the Users.GetLoggedInUser() function. The Message.Data.OculusID parameter correctly contains my account username, but the Message.Data.ID value is always 0 (zero) - so of course, my OVRAvatar instance wont load my customized avatar after setting the value provided to the avatar properties.

I have done this successfully in the past, and I believe the last time it worked correctly was before the Facebook account conversion. Has anyone else experienced this or might have suggestions as to how to fix it? 

A few things I have checked/tried:
1. I have put the correct APP ID (from my Oculus Dashboard) in both the Platform and Avatar settings with the Unity/Oculus menus in the Unity editor
2. I am initializing with Core.Initialize()
3. I'm calling Request.RunCallbacks() to avoid a race condition
4. If I use OVRManager's account override option in the editor to use one of my test user accounts from the Oculus dashboard, it DOES return a non-zero ID number.

I'm at a loss at this point. Any suggestions would be appreciated.



    6 replies

    JeffNik
    JeffNikAuthor
    Honored Contributor
    December 1, 2020
    For anyone interested... Oculus support was pretty quick in answering my question. Apparently, now, in the Oculus Dashboard, PER APP, you have to go to the API sub-menu and specifically request each platform feature - like obtaining user id and profile data, matchmaking, rooms functionality, etc. and GET APPROVED for access, which happened so quickly that I believe it was an automatic approval process.
    Up and Coming
    April 27, 2021

    Hi there, I'm having a similar problem where whenever I try to get any User.ID it returns zero, including with GetLoggedInUser(). On my app dashboard I have Leaderboards, Achievements, and Events active, is there another one I need to activate before I can get User data? Thanks!

    July 23, 2021

    I second this question. Which service has to enabled for  GetLoggedInUser to return actual data?

    New Participant
    March 23, 2021

    Thank you very much helped a lot and worked. I am getting the oculus id, I am getting the profile image, but my displayName is empty. any idea why? Thank you