cancel
Showing results for 
Search instead for 
Did you mean: 

oculus in app purchase not working - null reference

ssc_mikey
Honored Guest
I am trying to set up IAP in oculus but I get null reference on this call IAP.LaunchCheckoutFlow(sku).OnComplete(OnProcessingPurchasedProductCallback);

I have set up test user with always succeeds credit card settings. reference here (https://developer3.oculus.com/doc/1.0.0-platform/_o_v_r___requests___i_a_p_8h.html)

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");
        }
    }  

Anyone can help?
3 REPLIES 3

delphinius81
Rising Star
Are you sure that your Oculus.Platform.Core.Initialize() function call was successful? The only reason I know of for that to return null is if the platform was not initialized before making the call.

cybereality
Grand Champion
Moving to the Platform SDK forum in the Developer section.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

ssc_mikey
Honored Guest
i found out it was not successful. Looking for a way to fix it as it always return null