Trouble with In App Purchases IAP
I can't get IAP working.
In the developer dashboard:
- I have created an app
- done the data privacy checkup
- activated IAP on the platform services page
- created and published a SKU for testing
In unity
- Imported the Meta XR all-in-one SDK, and verified that platform services is a part of that
- 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
