The "Cannot connect to iTunes Store" issue may be due to one or more of the following reasons:
- The sandbox may be unreachable. Check the System Status for the status of the iTunes Sandbox.
- 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.
經(jīng)過排查,發(fā)現(xiàn)項(xiàng)目雖然填寫了build值,但是plist文件的Bundle Version字段丟失了值。

image.png
填上對應(yīng)的數(shù)值后,再進(jìn)行測試,就沒有問題了。
附錄:
In-App Purchase FAQ
SKError.Code
The status of the app receipt