Error code 2 when using Users.GetLoggedInUser() | Unity | Oculus Quest — Oculus
IMPORTANT:

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible: https://developer.oculus.com/quest-pitch/

For additional information and context, please see "Submitting Your App to the Oculus Quest Store".
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Error code 2 when using Users.GetLoggedInUser() | Unity | Oculus Quest

Hello,

I am following the documentation (https://developer.oculus.com/documentation/avatarsdk/latest/concepts/avatars-gsg-unity/) to use user specific avatars.
However, when I try to retrieve the user ID:
 void Awake () {
        Oculus.Platform.Core.Initialize();
        Oculus.Platform.Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);
        Oculus.Platform.Request.RunCallbacks();  //avoids race condition with OvrAvatar.cs Start().
    }

    private void GetLoggedInUserCallback(Message<User> message) {
        if (!message.IsError) {
            myAvatar.oculusUserID = message.Data.ID.ToString();
        }
    }
I always get the following error:
Code: 2
Http code: -1
Message: 'The user isn't signed in or their account state wasn't in a recoverable state.'

Using Unity 2019.1.5f1 and Oculus Integration 1.37

Any ideas what the cause might be?
Sign In or Register to comment.