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

后端 未结 20 2676
旧巷少年郎
旧巷少年郎 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.

提交回复
热议问题