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

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

    I had the same error, and after reading through some threads on the developer forums, I reset the settings on my device (Settings->General->Reset->Reset All Settings), which cleared it up. It seemed drastic, but it worked.

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

    Our problem was that in Itunes Connect we had the wrong bundle identifier. Someone had created the app before hand and we had to edit the app and set its appId to the new one.

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

    Make sure you have correct date and time set in the Settings. otherwise it fails to make a SSL conenction to the store!!

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

    What worked for me was to uninstall my app from the test device, then install a fresh copy from Xcode.

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

    In SKPaymentTransactionState tells that SKPaymentTransactionStateFailed before your request is added to server queue.

    @class SKPayment;
    
    enum {
        SKPaymentTransactionStatePurchasing,    // Transaction is being added to the server queue.
        SKPaymentTransactionStatePurchased,     // Transaction is in queue, user has been charged.  Client should complete the transaction.
        SKPaymentTransactionStateFailed,        // Transaction was cancelled or failed before being added to the server queue.
        SKPaymentTransactionStateRestored       // Transaction was restored from user's purchase history.  Client should complete the transaction.
    };
    typedef NSInteger SKPaymentTransactionState;
    

    And on SKPaymentTransaction Class Reference Error Discussion says:

    The error property is undefined except when transactionState is set to SKPaymentTransactionStateFailed. Your application can read the error property to determine why the transaction failed.

    So, transaction.error.localizedDescription is "Cannot connect to iTunes Store"! is a general error message.. I am also getting this error message regularly while testing my InApp Purchases.

    Some tips u can do is,

    1. Retrieve all products from app store using SKProductsRequest and check its response.products contain your requested productIdentifier. for this use,

      SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:[objProducts allKeys]]];
      //pass product identifier array as argument
      [request start];  
      

    And Catch response in :

        - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
            NSArray *myProduct = response.products;
    }
    

    So that you can decide is you can communicate to app store. and your product id is there.

    1. Make sure that you use In App test user account for testing.
    2. And you use the same app-id provisioning that you configured In App purchase.

    thanks

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

    Yeah, IF you've connected your iPad/iPhone to a different computer initially, and are now using it on another, you absolutely must sign out of store on your iPad, sign in w/ normal account to ITunes on your MAC, then Sync.

    Also, make sure your iPad "WIFI" is on...

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