How do I test restoring a purchase with the new .storekit in Xcode 12? When I call SKPaymentQueue.default().restoreCompletedTransactions()
, it goes straight to paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue)
with 0 transaction.
There is not a single mention of "restore" in this 25 minutes WWDC video, nor this documentation article also from Apple, nor in any of the handful tutorials on the Internet. What's even more puzzling to me is I can cannot find any complains/questions regarding this?!
I feel like I have gone mad. It would be great if someone can shed some lights. Thanks in advance!
Enable StoreKit Testing in XcodeClick the scheme to open the scheme menu; choose Edit Scheme. In the scheme editor, choose the Run action. Click Options in the action settings. For the StoreKit Configuration option, select a configuration file.
you can test in-app purchase with test account. then create an account for testing your in app purchase. when test in app purchase try to logout from app store which uses your real account. then it will ask for itunes account while in testing in app purchase then enter your test account credentials.
Just to confirm for people who find this via search: There is no way to unit test restoring purchases via the new Xcode 12 StoreKit Test tools (SKTestSession
and related).
The best you can do (again, as of early 2021) is to test this stuff the old fashioned way:
Fingers crossed for WWDC this year...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With