欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iPhone Store Kit “Cannot connect to iTunes Store”

程序员文章站 2022-07-12 08:39:57
...
When develop the IAP feature follow with the Apple IAP guide , I get a failed case:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

case SKPaymentTransactionStateFailed

with this error:
error Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x1e0edb60 {NSLocalizedDescription=Cannot connect to iTunes Store}

after lots of search, I found the solution in *:

引用
had a similar issue, was getting "Cannot connect to iTunes Store" with Code=0. This is how I solved it, after trying every other ritualistic piece of advice found on the Internet from re-downloading my certificates to resetting all my device settings to sacrificing a virgin black goat:

In the target summary for the app, I used to have my version number in the "build" field, but nothing in "version" field. This seemed odd to me, so I moved the version number from "build" to "version". This resulted in the aforementioned error. Moving the version number back to "build" solved the error.