Skip to main content
New Participant
June 21, 2016

A guide to plugging into the Oculus API for player information

Hey;

My google-fu isn't coming up with a lot of information on how to pull from the Oculus API information about the player.

I'm specifically trying to figure out how to grab the user's Oculus name to put in as the handle in an online multiplayer, and maybe even grab their friends names as well.

Engine is Unity.

    This topic has been closed for replies.

    13 replies

    Participant
    July 21, 2016
    @ProfessorTroy Thanks, I was looking for that documentation, but only ran across older ones. You'd think googling "Oculus docs" would get you there. ovr_User_GetSmallImageUrl looks useful

    Participant
    May 26, 2017
    @benpadget
    Thank you for sharing. I used your code,but still have some problems.

    I use the below codes to get the current user's oculusID, alread put in  App ID  & User Token in the PlatfromSetting.   Runing the codes in the Unity Editor. 
    It also returns:   
     
    DllNotFoundException: LibOVRPlatform64_1
    Oculus.Platform.StandalonePlatform.Initialize (System.String accessToken) (at Assets/OculusPlatform/Scripts/StandalonePlatform.cs:32)
    Oculus.Platform.StandalonePlatform.InitializeInEditor () (at Assets/OculusPlatform/Scripts/StandalonePlatform.cs:24)
    Oculus.Platform.Core.Initialize (System.String appId) (at Assets/OculusPlatform/Scripts/Platform.cs:114)
    JTestGetOculusAccount.Awake () (at Assets/JScripts/JTestGetOculusAccount.cs:13)

    So how can I fix these problem?


    void Awake()
        {
            Core.Initialize();
            Users.GetLoggedInUser().OnComplete((Message<User> msg) => {
                if (msg.IsError)
                {
                    Debug.Log(msg.GetError().Message);
                    return;
                }
                Debug.Log("Your name is " + msg.Data.OculusID);
            });
        }
    Inspiring
    May 26, 2017
    You might try removing any OculusPlatform package files (OculusPlatform folder and the corresponding files in Plugins), and reimporting the Platform package.

    Another thing to check, are you trying to do a 32-bit PC build? Maybe try switching to 64-bit build instead.