iPad In App Purchase fails with SKErrorPaymentCancelled and “Cannot connect to iTunes Store” [duplicate]

独自空忆成欢 提交于 2019-12-19 11:35:53

问题


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:

  1. I start the in app purchase.
  2. Confirm the purchase and sign in with the test user.
  3. Because this is a non-consumable product the App Store notifies me, that I have already purchased this but it hasn't been downloaded.
  4. Press OK.
  5. Up until now the transaction observer got a transaction with the transactionState SKPaymentTransactionStatePurchased and the user got his/her in app feature.
  6. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!