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
Just log out your iTunes account (don't login your test account now! ) , and start your program. When inapp purchase it ask your login details, you must enter your test account information.
The In-App Purchase FAQ says:
Cannot connect to iTunes Store
The "Cannot connect to iTunes Store" issue may be due to one or more of the following reasons:
- The sandbox may be unreachable.
- Your app does not have a bundle version (CFBundleVersion). See Setting the Version Number and Build String for more information.
- Your app is running in the Simulator, which does not support in-app purchase.
- You are attempting to purchase a product that is unavailable for sale. See Query the App Store for product information before presenting your app’s store UI for more information.
In my case, the error occurred because I was using the Xcode simulator. It started working when I used my device.
Even in the In-App Purchase Programming Guide says to use the development iOS device has a suggested testing step.