Skip to content

Entitlement Check using GVRF

Mihail edited this page Nov 13, 2017 · 7 revisions

Instructions

  1. Add the GVRf extension to your build.gradle
ext.gearvrfVersion='3.3.0'

dependencies {
    compile "org.gearvrf:platformsdk_support:$gearvrfVersion"
}
  1. Next add the following lines to your application's GVRMain.onInit() method:

    PlatformEntitlementCheck.start(gvrContext, "application-id", new
            PlatformEntitlementCheck.ResultListener() {
                @Override
                public void onSuccess() {
                    Log.i(TAG, "onSuccess");
                }
    
                @Override
                public void onFailure() {
                    Log.i(TAG, "onFailure");
                }
            });
    

    Note: Do not try to run the app here, it would only result in an error:

    E/gvrf: ovr_PlatformInitializeAndroid failed with error -1
    W/System.err: java.lang.IllegalStateException: Could not initialize the platform sdk; error code: -1
    W/System.err:     at org.gearvrf.PlatformEntitlementCheck.start(PlatformEntitlementCheck.java:63)
    
  2. Go to the Oculus Dashboard and create a new app. Update the API call above to use the provided app id.

  3. Make sure your app matches the Oculus manifest requirements :

    https://developer3.oculus.com/documentation/publish/latest/concepts/publish-mobile-manifest/

  4. Make sure the app is signed :

    https://developer3.oculus.com/documentation/publish/latest/concepts/publish-mobile-app-signing/

  5. Compile and upload your build to the dashboard's Store channel, address any issues raised by the build validator.

  6. Next, make sure your phone is connected to the Internet and the Developer mode is turned off. Insert the phone into the headset and launch Oculus home. Your app should now show up under library, go ahead and launch the app.

  7. Finally, running your app(even in developer mode) should result in an onSuccess() when performing the entitlement check.

Clone this wiki locally