“Cannot connect to iTunes Store” in-app purchases

前端 未结 17 2346
鱼传尺愫
鱼传尺愫 2020-12-01 06:13

I am having problems testing my in-app purchases. I get back valid product identifiers, but upon purchase I receive the dreaded \"Cannot connect to iTunes Store\". Interesti

相关标签:
17条回答
  • 2020-12-01 06:19

    I'm hitting the same issue. For me it happens after this secuence:

    • Install app on a device logged into a UK account on iTunes
    • Launch the app and use a test user set in USA
    • Message is shown saying account is only valid in USA. Closes the app and auto launches iTunes
    • Open your app again and retry purchase. Receive products but no other callback or error.

    I don't know whether this is an issue on the IAP platform but I would like to get an error/callback to handle it in some way in my code.

    To carry on testing your IAPs try any of these:

    1. Remove Provisioning Profile in Settings area, remove App and log out from Store in Settings. Then go to XCode and change the signing identities to "Do Not Sign" to then put them back (I know how it sounds :) but try) OR
    2. Hard reset all Settings on your device (Settings -> General...). Obviously you will loose any settings on that device...
    3. Kill iTunes app on the device (multitask menu) and log out from the Store on the Settings

    If none of the above work, it might be an issue on IAP platform, see my comments below.

    0 讨论(0)
  • 2020-12-01 06:23

    This is an old thread that is related to problem I was facing today.

    In my case, I was able to test in-app purchases on my device till yesterday but it stopped working today. It turned out that Apple had pushed an 'Amendment for Paid Applications' for me to review and agree to. Once I agreed to the amendment (without reading it, of course), everything started working again. Did not have to create a new test user or any other workaround.

    There may be many reasons for in-app purchases to not work but make sure you are correctly set up on itunesconnect or you won't be able to test in-app purchases.

    0 讨论(0)
  • 2020-12-01 06:23

    I was able to purchase in-app on iPhone but not on iPad(11.0.2). I tried with all mentioned solution but none helps. After trying all other possibilities, finally I was able to make it work.

    When you create a test account in iTunes connect, don't verify the email id. If it is verified, iap returns "Cannot connect to iTunes" error. It looks strange but it is how worked for me. In iPhone, irrespective of email verification, I am able to purchase using test account.

    0 讨论(0)
  • 2020-12-01 06:24

    see In-App Purchase FAQ: Cannot connect to iTunes Store

    Your app is running in the Simulator, which does not support In-App Purchase
    

    For testing in app purchases always use real devices.

    0 讨论(0)
  • 2020-12-01 06:26

    Here the exhaustive checklist if you got this error "cannot connect to iTunes Store" :

    • Make sure you have a sandbox user created in App Store Connect

    • Simulator DOES NOT support In-app purchase : test on real-device

    • The sandbox may be unreachable. Check the Apple System Status
    • Check that your app does have a bundle version (CFBundleVersion)
    • Check that the product is available for sale. Did you create it in App Store Connect?

    • If previous iOS 12, signed out of any production iTunes accounts on the device. Otherwise, you can just sign in within the dev app with your sandbox account.

    0 讨论(0)
  • 2020-12-01 06:28

    In addition to all the other methods outlined here, if you are working with subscriptions it seems you need to make sure you've generated a shared secret:

    "To test or offer auto-renewable subscriptions, you must have a master shared secret or use an app-specific shared secret for each app."

    A master shared secret is generated from the 'Shared Secret' tab of the 'Users and Access' section of App Store Connect.

    An app-specific shared secret is generated where you manage the in-app purchases of the app itself.

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