12-13-2022 09:14 AM
Hi, I have been trying to integrate IAPs into a Unity VR project using the Oculus SDK. I have a free consumable add-on defined in the developer console (I haven't set up payment info) and then in my C# code I have:
IAP.LaunchCheckoutFlow(product.Sku).OnComplete((res) => {
LaunchCheckoutFlowCallback(res, callback);
});
Everything up to this point - retrieving the add-on etc. - works perfectly, but then when I try to run this, a popup opens and instantly closes and then I get this error in the android logcat
[AndroidPlatformIntegration] In-app purchase failed. errorCode=0, httpStatusCode=0, errorMessage={"category":"user_canceled","code":0,"message":"The purchase has been canceled."}
and the Message<Purchase> (res) IsError is set to true in the LaunchCheckoutFlowCallback function, But I am not sure why.
This is a build from Unity, not an uploaded build and I haven't tested if that would work. But other than that I don't know why I am getting this error.
Thanks for any help!
12-14-2022 06:12 AM
@ellioteserin I'm having the exact same issue. The IAP was working fine and then suddenly stopped, so I suspect It's something on their side... I'm going to open a support ticket and I'll let you know if they find a way to solve the issue. Please do the same if you figure it out! 😊
12-14-2022 06:17 AM
Ah ok, good to know I'm not the only one! And ok that's great thank you, and will do!
Thanks!
12-20-2022 03:24 PM
I am having the same problem. Is so weird. We have 2 app submission pages to test this. We have one page that has the payment information in the developer section. But even then it didn't fix the issue. We have been approved for app lab too and still it doesn't work. How are we suppose to launch without this working? There is no documentation about error code 0 either. Would be nice to have an idea what each error means so we can fix the issue.
12-21-2022 07:08 AM - edited 12-21-2022 07:26 AM
Yeah, so I got this response from the Meta team, and to be honest, I don't know what else to do...:
"We recommend checking our developer documentation for possible solutions. If you are unable to resolve your issue or have additional questions, please let us know in the VR Developer Forum."
[Edit]
I've just created a thread in the Unity Forum as well to see if someone else stumbles into this problem and sees it there. Here's the link:
https://forum.unity.com/threads/oculus-integration-package-iap-error-code-0.1377210/
12-21-2022 09:17 AM
Also having this issue
12-23-2022 08:29 AM - edited 12-23-2022 08:55 AM
Disclaimer - I do not have expertise in this area. Please don't take this answer without verification.
This error message could be returned if the user who attempted to purchase this IAP was already entitled to the Consumable item but hadn't consumed that yet. This doc https://developer.oculus.com/documentation/native/ps-iap-s2s/ has details on how to retrieve it and consume.
12-24-2022 11:39 AM - edited 12-24-2022 11:41 AM
I think you are onto something. Weird that the examples don't show this line of process for consumables.
Consumable purchases must be ingested by your app before they can be made available for purchase again.
To launch the checkout flow for a user to complete the purchase of a specified SKU, use the following method.
ovr_IAP_LaunchCheckoutFlow()
To consume a purchased item on behalf of a user, which then marks the item as used, in-app, use the following method.
ovr_IAP_ConsumePurchase()
Will check it on my end see if player already has these items, but has not consumed it. So, the first time this checkout flow is called, it should return no error? Then, the second time, if its not consumed, it should return an error? We had errors happen always no matter what.
My thought is that we would want to consume it when the check out flow returns success message. But I never got a return message before. Will test some more.
12-25-2022 10:17 PM
I can verify this is not the issue right now. Thanks for the extra knowledge. I did not have the consume aspect for consumables. Now I do. But I have both consumables and durable and both throw the error.
I also did a check on the account when I pass entitlement to see if I have anything bought that is not consumed. But I did not.
12-26-2022 12:11 AM - edited 12-26-2022 12:17 AM
I print out a list of all the items the player has purchased. Then consume all those items to make sure any consumable item is cleared from the list.
The problem is that, when I purchase an item oculus returns an error code 0. (I did not have the item purchased before this. Consumable or Durable)
When I check the list of purchased item, I see oculus granted me the item as purchased.
Because I received an error from oculus I did not consume the item.
1. Why does oculus return error code 0 and set the item as purchased?
2. Why does oculus automatically close the accept buy window? When buying an item 3 dots appear and it looks like is about to do something, but then the request gets rejected.