title: In app purchase testing in iOS
body: <p>I am using <strong>Xcode 8.0, Swift 3.0</strong> and testing in app purchases in my iPad. <strong>I want to test in app purchases using sandbox user.</strong></p>
  
  <p><strong>There is no account added in device's Setting</strong></p>
  
  <p>The Problem is I am not getting product list in response of product request code.
  Please take a look on my code:</p>
  
  <pre><code>let PRODUCT_ID_MY_PRODUCT = "com.company.ProjectName.MyProduct"
  // The ProducID in this code and ProducID on iTunes are the SAME. ✔️
  
  override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
  
      if productID == nil {
          productID = PRODUCT_ID_MY_PRODUCT
      }
      SKPaymentQueue.default().add(self)
  }
  
  
  override func viewDidAppear(_ animated: Bool) {
      super.viewDidAppear(animated)
  
      startPurchases()
  }
  
  func startPurchases() {
      if (SKPaymentQueue.canMakePayments())
      {
          let productIDs = NSSet(object: self.productID!)
  
          let productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productIDs as! Set&lt;String&gt;)
          productsRequest.delegate = self
          productsRequest.start()
      }
  }
  
  
  // Delegate Methods for SKProductsRequest
  func productsRequest (_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
      let count : Int = response.products.count
         // THE PROBLEM IS HERE.. I AM GETTING COUNT IS ZERO.. MEANS response.products returning null ARRAY
      if (count&gt;0) {
          let validProducts = response.products
          for aProduct in validProducts {
              print(aProduct.productIdentifier)
          }
      } else {
          DispatchQueue.main.async(execute: {
              UIAlertView(title: "Purchase !", message: "Product not available", delegate: nil, cancelButtonTitle: "OK").show()
              return
          })
      }
  }
  </code></pre>
  
  <p>So..... That's the problem: I am getting response.products null (no data in array) so Please help me to find the solution. You can see the comments in code:
  // THE PROBLEM IS HERE.. I AM GETTING COUNT IS ZERO.. MEANS response.products returning null ARRAY</p>
  
  <p>I created products over iTunes Connect. You can see the image below. All the products are in <strong>"Ready to Submit" state.</strong> </p>
  
  <p>There is some warning on iTunes</p>
  
  <pre><code>Your first In-App Purchase must be submitted with a new app version. 
  Select it from the app’s In-App Purchases section and click Submit.
  
  
  Once your binary has been uploaded and your first In-App Purchase 
  has been submitted for review, additional In-App Purchases can be 
  submitted using the table below.
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yTXU9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yTXU9.png" alt="In-App Purchases iOS iTunes Connect Ready to submit state"></a></p>
  
  <p>And </p>
  
  <p>I also created <strong>Sendbox user for testing</strong> In-App Purchases. See the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/mXxcH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mXxcH.png" alt="Sendbox test user for In-App Purchases iOS itunes"></a></p>
  
  <p>Did I miss something? Or what is the error? And where is error? <strong>I want to test in app purchases using sandbox user</strong></p>