Hello Rob, thank you for the response. I believe it is better practice to call the “finishTransaction()” after the purchased item is delivered - I am doing it this way in all of my non-Corona apps and also the Corona documentation support it (https://docs.coronalabs.com/api/library/store/finishTransaction.html):
You must call this function following every successful transaction. If you don’t, Apple will assume that the transaction was interrupted and will attempt to resume it sometime after the next application launch.
If you’re offering the item as downloadable content, do not call this function until the download is complete.
The main issue is - if the transaction is interrupted. Even if I would be calling the “finishTransaction()” as soon as I get the “event.transaction” from Apple (without making sure the item was delivered by my server), it would still be possible the transaction being interrupted somewhere between “the credit card was charged” and “finishTransaction()”. In any way, the Apple should “attempt to resume it sometime after the next application launch”.
Considering the fact that it was working correctly a few months ago, I have tried to remove all plugins and everything that I have added during last few months and it has started to work again (eg. Apple attempt to resume the transaction as soon as I relaunch the app and call “store.init()”). By adding plugins one by one I have found the plugin that makes this issue - “plugin.admob”. Just by including the plugin in “build.settings” (even if I don’t “require( “plugin.admob” )”), this issue is happening. My knowledge of Corona is very limited, but I can see only two options:
-
Admob plugin is somehow interacting with the “store” plugin.
-
Admob plugin (not my Admob account, because it happens even if I don’t call “admob.init()” with my account credentials) is somehow interacting with my Apple/Corona account/plugin/device or there is something wrong in my build.settings or something.
My build.settings with correctly working “store” plugin:
plugins = { -- ["plugin.admob"] = { -- publisherId = "com.coronalabs" -- }, ["plugin.toast"] = { publisherId = "com.spiralcodestudio" }, ["plugin.utf8"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true } }, },
My build.settings where “store” plugin works only partly with the issue described before:
plugins = { ["plugin.admob"] = { publisherId = "com.coronalabs" }, ["plugin.toast"] = { publisherId = "com.spiralcodestudio" }, ["plugin.utf8"] = { publisherId = "com.coronalabs" }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true } }, },
Note: It is the only difference between two builds, and “require( “plugin.admob” )” is not called anywhere.
I kindly ask if you could investigate the issue to help me find where is the issue - I believe there is only very little I can do about plugins interaction and it is very unlikely that I could make “store” plugin behave this way just by adding “admob” plugin, but anything is possible. Not using the “admob” plugin is not an option for me, but it is currently the only way to make the “store” plugin work correctly.
I am using “2017.3068”.
Steps to reproduce:
Launch App > “store.init()” > Buy anything > Apple message “You are all set - Your purchase was successful.” > skip “finishTransaction()” > Relaunch App > “store.init()”
Apple should now attempt to resume the purchase and “transactionListener” should be called and you can easily get the “even.transaction” of the interrupted transaction and it is possible to finish the transaction/deliver the item.
Now include the “plugin.admob” and repeat the steps, now after:
Launch App > “store.init()” > Buy anything > Apple message “You are all set - Your purchase was successful.” > skip “finishTransaction()” > Relaunch App > “store.init()”
The apple doesn’t attempt to resume the purchase and “transactionListener” is not called. After going to buy the item again:
Buy the item again > Apple message “This In-App purchase has already been bought. - It will be restored for free” > “transactionListener” is not called and thus it is not possible to finish the transaction and it is not possible to buy the item anymore. On the other hand, if I try to purchase any other item (where “finishTransaction()” wasn’t skipped), everything works as supposed. So the purchase of interrupted item “stuck” and it is not possible to “clear” it, until I remove the “plugin.admob” and then - automatically after launch, the “stuck” item is delivered after “store.init()”.
Please note: It is only happening with “consumables”, in the case of “non-consumables” it works as supposed.
I know it sounds really strange, maybe I am missing something, but I am not able to narrow the issue because just including the “plugin.admob” is making the issue for me.
Thank you in advance
Martin