Oddities with iOS IAP
dan at clearvisiontech.com
Tue Aug 15 18:22:36 EDT 2023
Ok… seems to be working now. I’m no longer getting “completed”, but I am consistently getting “paymentRecieved”… and I can make that work. Obviously, I don’t really understand how this all works… but it’s working!
Thank you again for your help!
From: use-livecode <use-livecode-bounces at lists.runrev.com> on behalf of panagiotis m via use-livecode <use-livecode at lists.runrev.com>
Date: Tuesday, August 15, 2023 at 10:24 AM
To: How to use LiveCode <use-livecode at lists.runrev.com>
Cc: panagiotis m <merakosp at gmail.com>
Subject: Re: Oddities with iOS IAP
Just a rough guess, in the purchaseStateUpdate msg, you have:
mobileStoreConfirmPurchase pProductID //Inform the store that the purchase
identifier productID was successfully delivered
in both cases for paymentReceived and restored.
Could you try commenting out the mobileStoreDisablePurchaseUpdates in these
2 cases? Once you call mobileStoreConfirmPurchase, it informs the store
that the purchase was successful, and then the store sends another
"purchaseStateUpdate" with state=complete.
But if you call mobileStoreDisablePurchaseUpdates just after
mobileStoreConfirmPurchase then this stops the communication with the
store. I suggest having mobileStoreDisablePurchaseUpdates just in the
"complete" case and remove it from "paymentReceived" and "restored".
Note that on Android (if I remember correctly)
mobileStoreEnablePurchaseUpdates/mobileStoreDisablePurchaseUpdates do not
actually do something - but they are added for consistency.
If you do this change, and still see the delay, then it is likely a
TestFlight/Sandbox issue. Note that Apple's sandbox servers are slower than
the actual ones used by StoreKit.
More information about the use-livecode