fieldsye / in-app-purchase-air-ios

Automatically exported from code.google.com/p/in-app-purchase-air-ios
0 stars 0 forks source link

Restoration of transactions not working? #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create some non-consumible IAPs.
2. Add an event listener for UPDATED_TRANSACTIONS.
3. Call restoreTransactions.

What is the expected output? What do you see instead?
According to the usage sample I assume the UPDATED_TRANSACTIONS event should be 
dispatched, however that's not happening, so if I delete my app and then 
reinstall it I don't know if I already bought some product.
If I try to buy the product once more, I receive an alert saying it is already 
purchased, and it will be downloaded once again, and I receive an 
UPDATED_TRANSACTION event with the transaction set to 
Transaction.TRANSACTION_STATE_FAILED. I don't know if that's to be expected, 
but if it is so, it adds another problem: when it is safe to assume that the 
failed state is from a paid product?

What version of the product are you using? On what operating system?
The ANE is the Nov 4th version. Tested on an iPhone 4.

Original issue reported on code.google.com by neverbi...@gmail.com on 14 Dec 2011 at 2:49

GoogleCodeExporter commented 9 years ago
Restored the iPhone to its factory defaults, and the restoration is now working 
fine. I guess some of my previous caused some constant conflict.

Original comment by neverbi...@gmail.com on 20 Dec 2011 at 9:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
happens to me too... i'm assuming 
AppPurchase.manager.restoreTransactions();

is supposed to call the Update but no update is being dispatched... very strange

Original comment by da...@heartbyte.com on 4 Feb 2012 at 5:30

GoogleCodeExporter commented 9 years ago
I haven't had any problem with the restoration again, but it was rather strange 
indeed... well, hope it won't pop up again.

Original comment by neverbi...@gmail.com on 4 Feb 2012 at 9:10

GoogleCodeExporter commented 9 years ago
I still get these issues. I just want to get a list of products they've already 
purchased... I'm testing with sandbox usernames and passwords.

Original comment by da...@heartbyte.com on 23 Feb 2012 at 7:51

GoogleCodeExporter commented 9 years ago
I've have experienced this issue. It seems very random and unpredictable. 
Sometimes it works and then it doesn't work for while.
People have experienced these sort of issues with StoreKit:
http://stackoverflow.com/questions/1726654/skpayementqueue-restoring-transaction
s-finishes-without-calling-updatedtransac
http://stackoverflow.com/questions/7996056/updatedtransactions-failed-to-be-call
ed-back-after-ios-4-2

Original comment by prank...@gmail.com on 29 Mar 2012 at 5:47

GoogleCodeExporter commented 9 years ago
i'm also unable to retrieve already made purchases... the UPDATE event simply 
doesn't fire after calling      
    AppPurchase.manager.restoreTransactions();

Original comment by K2xL....@gmail.com on 6 Apr 2012 at 7:32

GoogleCodeExporter commented 9 years ago
Hi k2xl. I am looking into it. Thanks for reporting.

Original comment by saumitra...@gmail.com on 7 Apr 2012 at 4:45

GoogleCodeExporter commented 9 years ago
Just in case, wanted to comment I haven't suffered from this problem since I 
restored my system, nor I received any notification of this problem from anyone 
testing my apps.

Original comment by neverbi...@gmail.com on 7 Apr 2012 at 9:06

GoogleCodeExporter commented 9 years ago
Any chance there could be an issue with 5.1? An app that had in app purchases 
was previously working fine in terms of purchasing the in app purchases. Now 
testing on 5.1 it doesn't appear to work at all.

Original comment by mediakit...@gmail.com on 8 Apr 2012 at 8:19

GoogleCodeExporter commented 9 years ago
I think there are changes in 5.1, because it seems if there are pending 
transactions, now the system tries to finish them dispatching restored 
transactions events. Or so it seems, but the ANE works fine as always.

Original comment by neverbi...@gmail.com on 8 Apr 2012 at 8:28

GoogleCodeExporter commented 9 years ago
Thanks Neverbi. I just had a new app rejected that used the exact same code for 
in app purchases - with Apple claiming the in app purchases didn't work. I have 
tested on my iPad with IOS 5.1 newly installed and they don't appear to work. 
They definitely worked previously so very confused. I also tested another app 
that is in the app store that I previously had accepted that has the same 
implementation and worryingly the in app purchases are not working on my iPad. 
I am going to reset my iPad to factory settings to be sure it is not a prob 
with my iPad though it does seem that Apple found an issue...

Original comment by mediakit...@gmail.com on 8 Apr 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Neverbi - out of interest, did you publish with AIR 3.1 or 3.2?

Original comment by mediakit...@gmail.com on 8 Apr 2012 at 9:30

GoogleCodeExporter commented 9 years ago
I tried an app I have with IAP just a week or two ago, with both SDKs, 3.1 and 
3.2, and had no problems.

Original comment by neverbi...@gmail.com on 8 Apr 2012 at 10:10

GoogleCodeExporter commented 9 years ago
Can anyone confirm if the AppPurchaseEvent.RESTORE_COMPLETE should be called if 
a user attempts to restore a non consumable transaction that they have not 
previously purchased. Just did a quick test with some debugging and I noticed 
that when I tried to restore with a completely new test user the "Restore 
COMPLETE" text was being written to the debug text field.

AppPurchase.manager.addEventListener(AppPurchaseEvent.RESTORE_COMPLETE,function(
e:AppPurchaseEvent):void{if (_traceLog) _traceLog.appendText("\n> Restore 
COMPLETE");});

Original comment by mediakit...@gmail.com on 8 Apr 2012 at 10:11

GoogleCodeExporter commented 9 years ago
Thanks Neverbi - after a factory reset, the in app seems to be working 
correctly on my new app though weirdly and rather worryingly not working at all 
with the app that is currently in the app store:(

Original comment by mediakit...@gmail.com on 8 Apr 2012 at 10:49

GoogleCodeExporter commented 9 years ago
Just curious, are you using your own server to validate the receipts?

Original comment by neverbi...@gmail.com on 10 Apr 2012 at 11:20

GoogleCodeExporter commented 9 years ago
I'm using the sample code provided on the wiki with a non-consumable product 
and had to make these changes:

1. In onUpdate, on a successful restored transaction I have to call 
AppPurchase.manager.finishTransaction(t.transactionIdentifier) to get it to 
remove the transaction and stop the uninitiated restores on launch, and not 
t.originalTransaction.transactionIdentifier as listed.

2. Also in onUpdate check for TRANSACTION_STATE_FAILED and call  
AppPurchase.manager.finishTransaction(t.transactionIdentifier) on those 
transactions.

When I didn't do these things the queue was clogged and I got the "you've 
purchased this but it hasn't been downloaded" message. Now when I purchase with 
a clear transaction queue I receive "you've already purchased this, click OK to 
download" as expected. 

When I need to call restoreTransactions it's all working fine. Using CS5, AIR 
3.2 but iOS 5.0.1 however not 5.1.

Hope this helps, thanks for making this project available.

Original comment by b.t.mcgu...@gmail.com on 3 May 2012 at 7:27