Works the same on an iPhone 6(7?) Plus with iOS 10.0.2.
Did you call just iap.set_listener() ? Without buing product one more time?
Yes, Iām calling iap.set_listener() in the init function of a gui_script. I do not try to buy the product again. Calling iap.set_listener() should trigger a callback of any purchase that hasnāt been finished in a previous run of the application.
From Apple docs:
Finishing a transaction tells StoreKit that youāve completed everything needed for the purchase. Unfinished transactions remain in the queue until theyāre finished, and the transaction queue observer is called every time your app is launched so your app can finish the transactions. Your app needs to finish every transaction, regardless of whether the transaction succeeded or failed.
The restore process does not return a product if it has an unfinished transaction in the payment queue.
If you donāt finish Appleās transactions, it will mess up things.
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/DeliverProduct.html
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html
It works!!! Thank you!!!
As you can see on my sad example current manual doesnāt help with non-consumable purchase at all.
I think it need to make some changes about it in manual:
- different way of restore purchaise (TRANS_STATE_PURCHASED only on ios even if iap.restore recive true on android) - is it still right behavior?;
- no need to finish transaction on android if user want non-consumable item (But still need on ios);
- if purchase was not finished ios will call callback on start of the app for continue purchase;
- have no callback on ios if you try to buy non-consumable product one more time (but has this callback on android).
This is confusing when I saw that it works the same way on ios and android with consumable purchases. When I try to use non-consumable and has many difference.
I really happy that it was not an engine bug.
And I hope that my pain will help to some developers in future =)))
And one more question about this theme:
Do you have plans to implement callback when purchase was refunded?
Yes, this is a bit unfortunate, but I believe itās likely caused by the fact that we do not have any non-consumable items in our King games. I will see what we can do to improve the documentation.
Yes, I believe this is an oversight on our part. I would expect a callback to be invoked in this case. Iāll look into it.