问题
Possible Duplicate:
iPhone storekit sandbox stopped working.
Hi.
I updated today to version 3.2.2 of the iPad iOS and I noticed that my In App Purchase testing was not working.
I am using a test account and everyhing was working until now (our app is already live since june and the real in app purchase works), but today I wanted to make a test purchase with the same product and test user that I always used and now it's not working.
The problem is as follows:
- I start the in app purchase.
- Confirm the purchase and sign in with the test user.
- Because this is a non-consumable product the App Store notifies me, that I have already purchased this but it hasn't been downloaded.
- Press OK.
- Up until now the transaction observer got a transaction with the transactionState SKPaymentTransactionStatePurchased and the user got his/her in app feature.
- But now the transactionState is SKPaymentTransactionStateFailed with the error:
Error Domain=SKErrorDomain Code=2 UserInfo=0x2debe0 "Cannot connect to iTunes Store"
Code=2 means SKErrorPaymentCancelled. WTF? This should happen if the user canceled the transaction, not in a real error. This is very misleading. I am not supposed to show this as an error because most of the time this is called if a user really cancels his/her purchase and there is no way to determine whether this error was caused by the user or by the App Store.
Everything is set up correctly, as I mentioned the in app purchase testing worked and I get the products as valid. Also I didn't change the code handling the in app purchase.
The error must be somewhere on the App Store side.
Does anyone else had this problem?
Thank you.
Update
I tested the app on the iPhone (it's a universal app) running iOS 4.0.2 and the error looks like this:
Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x2620e0 {NSLocalizedDescription=Cannot connect to iTunes Store}
The Code=0 is SKErrorUnknown and the app displays an error to the user.
So it seems that iOS 4.0.2 handles this problem better than iOS 3.2.2.
回答1:
I tested again and fortunately it seems that the problem is gone. I can test the in app purchase without any problems.
I hope it works now for others, too.
来源:https://stackoverflow.com/questions/3532259/ipad-in-app-purchase-fails-with-skerrorpaymentcancelled-and-cannot-connect-to-i