Hi,
When a user attempts to purchase an IAP, I make the purchase button spin and stop it either when "on product owned" or "on product purchase failed" triggers.
I tried entering an IAP promo code as payment method and the icon kept spinning.
So it looks like "on product owned" doesn't trigger when a promo code is used (like it does when using a credit card or if the user is a licenced tester) - is this a bug?
I'm working on a workaround where:
- User clicks the button (and I make it spin)
- Set a "purchaseAttemptInProgress" bool = TRUE
- Every tick and if that bool = TRUE, check "has product"
- If "has product" = TRUE, then register the IAP and set that bool = FALSE
- If "on product owned" triggers, then I can do the same.
- If "on product purchase failed" set the bool to FALSE and stop the icon spinning
- If the user closes the window with the IAP button, then also set it to FALSE and stop the button spinning.
Also, does anyone know what can cause "on product purchase failed" to trigger? Specifically, does "purchase product" ever time out?
As it stands, the button will keep spinning unless one of the above conditions is met - although I don't think this will be a problem.