cancel
Showing results for 
Search instead for 
Did you mean: 

Ways to debug when connected to Gear VR Headset in order to debug in app purchase process

ssc_mikey
Honored Guest
Hi there. I am trying to implement in app purchase using oculus store to my current project for Samsung Gear VR. I have set up everything and it works like charm inside unity. Unfortunately when i build the app and connect it to head set literally nothing happens when i tap on button to make a purchase. I have tried to debug it. In order to do so i have enabled VR developer mode and run the app on the phone itself while connected through USB to my Mac. Debug log says it behaves like it was inside the unity not in the Gear VR headset. So I wonder if VR developer mode should behave like it was connected to real Gear VR or it behaves like it is not. How do i find out what causing the problem? 

Thank you
5 REPLIES 5

ssc_mikey
Honored Guest
I have managed to debug over wifi while connected to gear vr headset.

This is the debug log i get:

ka2s7rzwehic.png

And here is my code:






public static void InitiatePurchase(string sku) 

    {

        Debug.Log ("SKU IS " + sku);

        // For testing within the Unity Editor, I highly recommend you short-circuit your IAP callback flow in some way that your user is simply granted access to the purchase

        if (Debug.isDebugBuild) 

        {

            Debug.Log ("CoinPackage one was prourchased inside unity");

            Coin_package_one_purchased();

        }

        else

        {

            Debug.Log ("CoinPackage one is being purchase inside oculus");

            IAP.LaunchCheckoutFlow(sku).OnComplete(OnProcessingPurchasedProductCallback);

            Debug.Log ("check out flow has been launched");

        }

    }
  

it means i get null reference on this call IAP.LaunchCheckoutFlow(sku).OnComplete(OnProcessingPurchasedProductCallback);

josh_ruesch
Explorer
Are you calling Oculus.Platform.Core.Initialize() successfully? If you don't initialize the SDK successfully, all of the requests return a null pointer.

ssc_mikey
Honored Guest
i am calling it but for some reason it is not succesfull. Dont know what can be the problem

delphinius81
Rising Star
Did you provide your platform api keys to Unity through the Oculus Platform -> Edit Settings menu option? Alternatively, you can pass your api key during the Initialize() function call. 

ssc_mikey
Honored Guest
Yes I did. I have set up both the id and token as well.