title: iPhone InApp Purchase problem - canMakePayments always fails
body: <p>I've searched hard for this issue and there were similar questions but couldn't find answers to my issue.</p>
  
  <p>The problems is that '[SKPaymentQueue canMakePayments]' always fails. The code is extremely simple as follows.</p>
  
  <pre><code>if ([SKPaymentQueue canMakePayments]) //
  { 
      NSLog(@"able to make payments");
      [[SKPaymentQueue defaultQueue] addTransactionObserver:g_custom_store_observer]; // Register the observer
  
      SKMutablePayment *myPayment = [SKMutablePayment paymentWithProductIdentifier: strItemName];
      myPayment.quantity = 2;
      [[SKPaymentQueue defaultQueue] addPayment:myPayment];
  }
  else{
      NSLog(@"not able to make it");
      return KD_FALSE;
  }
  </code></pre>
  
  <p>I think I missed something in the testing process. What I did so far was</p>
  
  <ul>
  <li>Registered my app to iTunesConnect (Created a new App, and checked the Bundle ID)</li>
  <li>Set up the 'Rights and Pricing', mine is 'free' app</li>
  <li>Added 'consumable Items' from the 'Manage In-App purchases' menu on the iTunesConnect.
  filled all the text fields, uploaded image for review, and all of them are in '  Waiting for Review  ' status now.</li>
  <li>created a test user</li>
  <li>Rebuilt(cleand and build) my App, checking the Bundle ID, code-signed with proper distribution certificate. the bundle ID is exactly the same as the one shown in the App details on the iTunesConnect page.</li>
  <li>Uploaded my newly built App to the iTunesConnect (Uploaded binary, no code-signe error) and now is in 'Waiting For Review' status.</li>
  <li>Now I wanted to check the In-App purchase work or not, I ran debug version of my App on my iPad device. It's built in Debug mode, code-signed with my developer certificate, exactly the same code uploaded to iTunesConnect.</li>
  <li>On my iPad, I logged out from iTunesStore</li>
  <li>Ran my App</li>
  <li>When I trigger the code above, 'canMakePayments' always fail.</li>
  </ul>
  
  <p>The only thing different from other normal iPhone Apps is that mine is OpenGl based game, so the most of the codes are written in C++, interfacing with iPhone platform specific stuffs written in ObjectiveC/C++.</p>
  
  <p>So the code above is called from C++ module, and no iOS specific UIViewController is not created yet. Do I need UIViewController before I call [SKPaymentQueue canMakePayments] ??</p>
  
  <p>Did I miss something?</p>
  
  <p>Thanks in advance.</p>