iPhone In-App Purchase Store Kit error -1003 “Cannot connect to iTunes Store”

后端 未结 20 2582
旧巷少年郎
旧巷少年郎 2020-11-29 02:49

I\'ve been working on adding in-app purchases and was able to create and test in-app purchases using Store Kit (yay!). During testing, I exercised my app in a way which cau

相关标签:
20条回答
  • 2020-11-29 03:10

    I fiddled around with going to the App Store and then back to Settings/Store to Sign Out. I did this 3 times, revisiting my app each time and adding debugging NSLog output, and now I am able to continue testing my in-app purchase code without error -1003. I am not sure the exact reason for this working again, but I am fairly certain is is not a code change on my part as all I was doing was adding NSLogs and re-running my app.

    0 讨论(0)
  • 2020-11-29 03:12

    I had the same error that seemed to pop up out of nowhere (was working fine one day, but then the next day it was giving me these errors about 2 out of every 3 times I tried testing my in-app purchase).

    Then I visited the App Store (when trying to make another real purchase), and realized that they had a new user agreement that they wanted me to verify. After I did that, when I went back to my own app and tried out the test purchase again, it was working fine and have had no errors since. So I suspect I was getting the error because they wanted me to verify the new user agreement.

    Now the only thing I wonder is if there is a way for my in-app purchase to forward that prompt to my users instead of giving them a mysterious error?

    0 讨论(0)
  • 2020-11-29 03:13

    I had a similar situation and dumped the iPhone's network traffic to see what's going on. I found that the normal store was contacted instead of the sandbox. It helped to delete the app from the device, make clean and build/install it again. Apparently something with the development profile had gone wrong.

    Update: To dump the network traffic of a non-jailbroken iPhone, just use Internet Sharing on your Mac and configure your iPhone to use your Mac's WiFi. Then tcpdump -n -i en1on your Mac will do the trick.

    0 讨论(0)
  • 2020-11-29 03:15

    I had a similar issue, was getting "Cannot connect to iTunes Store" with Code=0. This is how I solved it, after trying every other ritualistic piece of advice found on the Internet from re-downloading my certificates to resetting all my device settings to sacrificing a virgin black goat:

    In the target summary for the app, I used to have my version number in the "build" field, but nothing in "version" field. This seemed odd to me, so I moved the version number from "build" to "version". This resulted in the aforementioned error. Moving the version number back to "build" solved the error.

    0 讨论(0)
  • 2020-11-29 03:15

    In my case, I tried everything in the internet, but nothing worked.

    Apple actually broke the production payment system, and the sandbox. I just had to wait two days, and it started to work.

    0 讨论(0)
  • 2020-11-29 03:17

    I had two problems that caused this:

    1) I had copied the IAP code from a different (working) app but had missed setting up my observer:

    observer = [[IAPHelper alloc] init]; [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

    2) I was logged in to iTunes in the settings of my device. You can only use a test user in the sandbox - I logged out and it worked again.

    0 讨论(0)
提交回复
热议问题