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

后端 未结 20 2583
旧巷少年郎
旧巷少年郎 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:19

    If you're getting error 0 "Cannot connect to iTunes Store" (which I realize is not the error -1003 that OP asked about, but a web search for error 0 also leads here), this can be caused by two possible problems:

    1. You're passing in the wrong product identifier. If that's the case, then you'll get error 0 shortly after calling -[SKPaymentQueue addPayment:], before you get the popup asking you to confirm payment.
    2. Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.

    To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.

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

    I tried every solution offered in the thread here, but to no avail. In my case, I had a wild-card bundle identifier starting with the same domain name as the one I used while creating the bundle identifier for in-app purchase provisioning profile.

    Here is how I fixed the problem and may help you fix yours (See attached):

    1) Connect your iPhone to Mac.

    2) Under the "Devices" (in Xcode > Window menu > Organizer window) select the "Provisioning Profiles" option for your iPhone. You will see all provisioning profiles currently residing on your iPhone.

    3) Carefully remove all provisioning profiles starting with the particular domain name in the bundle identifier (com.MYDOMAIN.*) especially the ones that use wild-card except for the one you create specifically with the ability to do In-App purchase (com.MYDOMAIN.inappidentifier).

    4) Install the app afresh and test your implementation with a fresh iTunes connect test user (sandbox)

    SCREENSHOT:

    enter image description here

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

    I Did a Clean all Targets in XCode and manually deleted the application off my device, then Build and Run from XCode and it fixed a similar problem (Same error message but different error code:-1009)

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

    I have been stuck for 2 days, here's my solution:

    1. Remove all in-app-products.
    2. Remove new in-app-products.
    3. Create a sandbox tester.
    4. Log out my apple account from device (iPad), and then try to buy the product.
    5. It will ask for login, then re-login with the sandbox tester account.
    6. Purchase goes through.

    I think the importance is the sandbox tester account, I have not used it before since I always got error-0.

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

    Add new test user for your app.

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

    Unfortunately, I ran into a problem that was not documented here. In-App-Purches will not work until you accepted all contracts related to app- and in-app-purcheses. So make sure you (or your customer) set up all contracts in iTunesConnect properly, they must appear in the "Contracts In Effect" section to make your purchaes work.

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