应用程序内购买返回0个产品和invalidProductIdentifier

adi*_*dit 3 iphone objective-c ipad

我只是检查和我的:

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
Run Code Online (Sandbox Code Playgroud)

返回了SKProducstResponse,产品数组大小为0.这是为什么?如果找不到产品,它应该返回0对吗?我检查了产品ID,它与我在itunes connect中的ID相匹配.检查了捆绑包标识符,它也匹配..是的,我在设备上测试了它

更新:

我查了一下

response.invalidProductIdentifier
Run Code Online (Sandbox Code Playgroud)

它返回了我试图获取的productID.我浏览了这个清单:

• your app is InApp Purchases enabled? **yes**
• do you have an InApp Purchase test account? **yes**
• the product we offer is marked as "Cleared for Sale"? **yes**
• Did you upload the application to iTunes Connect? **no** (don't think it's necessary since 2011, correct me if I am wrong)
• do you generate and install a provisioning profile for the new "App ID"? **yes**
• Does your project is signed with the new provisioning profile? **yes**
• Are you compiling the project for IOS 3.0 or higher? **yes** 
• Are you using the full product ID when you make a SKProductRequest? ie for example: com.company.sampleapp.productid? **yes**
• Has it been several hours since you added the products to iTunes Connect? **yes**
• Does the contract payment application in the iTunes Connect is complete?  **just submitted it**
Run Code Online (Sandbox Code Playgroud)

为了让IAP运行,我是否真的应该使用付费合同?

mar*_*cus 5

参考你的帖子:

•您在制作SKProductRequest时是否使用完整的产品ID?即例如:com.company.sampleapp.productid?

实际上,您需要准确指定您在iTunes Connect中输入的字符串(productId)作为应用程序内购买项目.因此,如果您指定productId,您的SKProductRequest需要具有该字符串集(没有任何com.ab).如果您在iTunes中指定了com.a.b.item(建议使用)类似的内容,则需要在产品请求中完整设置.

编辑 帖子应用程序内购买指出,付费应用程序合同必须有效,以允许在应用程序购买.所以它可能是你的问题的原因.