cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with In App Purchases IAP

katemode
Honored Guest

I can't get IAP working.

In the developer dashboard:

  1. I have created an app
  2. done the data privacy checkup
  3. activated IAP on the platform services page
  4. created and published a SKU for testing

In unity

  1.  Imported the Meta XR all-in-one SDK, and verified that platform services is a part of that
  2.  Set my app ID for both "oculus rift" and "Meta Quest/2/Pro"

 

In my script I have the following

 

void Awake ()
    {
        try
        {
            Core.AsyncInitialize();
#if UNITY_ANDROID && !UNITY_EDITOR
            IAP.GetViewerPurchases().OnComplete(ViewerPurchasesCallback);
#elif UNITY_EDITOR
            Debug.LogWarning("Running in Unity Editor. Oculus platform initialization is skipped.");
#endif
        }
        catch(UnityException e)
        {
            Debug.LogError("Platform failed to initialize due to exception.");
            Debug.LogException(e);
            // Immediately quit the application.
            UnityEngine.Application.Quit();
        }
    }

    void ViewerPurchasesCallback(Message<PurchaseList> msg) {
        Debug.Log("Callback");
        if (msg.IsError) {
            Debug.LogError("Error retrieving purchases: " + msg.GetError().Message);
            Debug.LogError("Error retrieving purchases: " + msg.GetError().Code);
        } else {
            foreach (Purchase purchase in msg.Data) {
                Debug.Log("User has purchased: " + purchase.Sku);
            }
        }
    }

 

 

I get the error message

"Error retrieving purchases: package not in library"

"Error retrieving purchases: 2"

 

I can not find any documentation with that error message or any information about error codes

0 REPLIES 0