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 will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

S2S Api calls working as standalone in Unity editor but not when running on Oculus Go / Gear VR

I've been developing a simple arcade shooter and I've implemented a simple leaderboard. The leaderboard is able to poll the Oculus leaderboard server within Unity when I'm logged in as a standalone user on my account, but when I run the same code on my Oculus Go the server always returns a fail. AFAIK I'm passing the entitlement check since I've implemented code to alert me if this is not the case. The build has been loaded into Alpha and I've also tried RC channels but I'm still encountering the same issue.

It's frustrating since I know the code is good since it works within Unity, but never once have I been able to access the leaderboard on my test unit.

My entitlement check is exactly the code listed here https://developer.oculus.com/blog/unity-engine-entitlement-checks-for-gear-vr-and-rift/
And my leaderboard code is based on the hoops example, which is working in Unity to write and read scores successfully.

I realise this isn't much to go on but I don't know where else to turn now. I hope it's something obvious I'm not doing and someone out there knows how to help me.
Thanks

Answers

  • bobbagoosebobbagoose Posts: 8
    NerveGear
    edited September 2018
    So I think the line that's causing me issues is this:
    Leaderboards.GetEntries(USER_SCORE, TOP_N_COUNT, LeaderboardFilterType.None,
              LeaderboardStartAt.Top).OnComplete(HighScoreGetEntriesCallback);

    It returns this when I try and access it. The error doesn't appear when I use standalone credentials.
    NullReferenceException: Object reference not set to an instance of an object

    EDIT: So Core.AsyncInitialize(); is failing on my Go. My app ID is correct and it's in a release channel and I'm running the build I've downloaded from the store. I'll keep digging into it but I'm really. not sure where I've gone wrong.

    EDIT2: I've tried creating a brand new app, with a. new appID and I'm still not passing entitlement. I've stripped the entitlement check down to a barebones implementation and embedded it directly into my leaderboard script so I can ensure it runs before calling the leaderboard.

    N.b. I'm using leaderboardConstructor.LeaderBoardError() to display the output in the game.

    It's not even running CheckEntitlement() as AsyncInit has failed and it's caught with the error, displaying "Failed" in the game.

     private void Start()
        {
            try{
                Core.AsyncInitialize();
                CheckEntitlement();
                leaderboardConstructor.LeaderBoardError("Getting scores...");
            } catch {
                leaderboardConstructor.LeaderBoardError("FAILED");
            }
        }

        void CheckEntitlement()
        {
            Entitlements.IsUserEntitledToApplication().OnComplete(
            (Message msg) =>
            {
                if (msg.IsError)
                {
                    // User is NOT entitled.
                    Debug.Log("Error: User not entitled");
                    UnityEngine.Application.Quit();
                }
                else
                {
                    // User IS entitled
                    Debug.Log("Success: User entitled");
                    CheckForUpdates();
                }
            }
        );
        }
    Edit 3: I've tried a build with IL2CPP as I read this fixed the issue for another developer in the same boat. No dice. My Android api levels are 21 min, 23 max. I deployed a build with Core.Initialize, instead of AsyncInitialize - same issue.
  • bobbagoosebobbagoose Posts: 8
    NerveGear
    This post is my saviour:
    https://forums.oculusvr.com/community/discussion/67548/entitlement-check-completes-but-vrc-validator-submitted-builds-fail

    I just need to update my platform SDK since I was using the version from Unity store. It didn't even register to check this since everything else was working flawlessly. I'm so happy now, I'm getting a beer.
Sign In or Register to comment.