IAB doesn't fully function in the latest Gideros release (2015-09).
The issue is listed in Github (
https://github.com/gideros/gideros/issues/151):
This code causes an unnecessary authentication:
iab = IAB.new()
This code does nothing:
iab:restore()
I'm looking for ideas on how to solve this, to get back IAB functionality to iOS.
These issues don't exist on iOS 7, so it appears to be an iOS 8+ problem. Remarkably I haven't been able to find an up-to-date API for iOS 8, the latest doc seems to be this:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Any help on this is appreciated!
Niclas
Comments
iab:restore does nothing
Here is the current iab restore code:
https://github.com/gideros/gideros/blob/master/plugins/iab/source/IOS/Plugins/iab/IabIos.mm#L73-L75
Here is the documentation on iab restore from apple:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9
New way seems to be using app receipts, but there is also a text like:
If you need to support versions of iOS earlier than iOS 7, where the app receipt isn’t available, restore completed transactions instead.
So let's got to Restoring Completed Transactions section
There is says:
Your app starts the process by calling the restoreCompletedTransactions method of SKPaymentQueue.
but in older code we have
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
Which does not make sense as it is exactly what we have.
Next step, flipping table and dumping Apple, sorry for wasting your time, but at this point I have no idea myself.
Maybe it is related to the authentication in the begining.
Checking initialization.
IAB.new() runs init method, which is
https://github.com/gideros/gideros/blob/master/plugins/iab/source/IOS/Plugins/iab/IabIos.mm#L13-L19
The only line that could cause it is:
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
which registers us to receive callbacks. So maybe for some reason it does not register us to receive callbacks, that is why iab:restore does nothing, but it means also iab:purchase should not complete the purchase too, does it?
Maybe the next step is to isolate the code completely to be sure it's not the game code that's causing this (for some strange reason). Will try this.
No not happened yet, still waiting
1. I created a clean build. It worked as expected!
2. I tried the old, unchanged, app on Testflight. IT WORKED AS EXPECTED.
@ar2rsawseen, The only thing that makes sense is that Apple had some network issues in the last couple of days. I am going to take a deep breath and apologise for reporting it in the first place.
No problem