Iphone 应用内购买返回0个产品和invalidProductIdentifier
我只是检查一下,我的:Iphone 应用内购买返回0个产品和invalidProductIdentifier,iphone,objective-c,ipad,Iphone,Objective C,Ipad,我只是检查一下,我的: - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { 返回了产品数组大小为0的SkProducsResponse。为什么会这样?如果找不到产品,它应该返回0,对吗?我检查了产品ID,它与我在itunes connect中的产品ID匹配。已检查捆绑包标识符,并且该标识符也匹配。。是的,我在一台设备上测试了这个 更新:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
返回了产品数组大小为0的SkProducsResponse。为什么会这样?如果找不到产品,它应该返回0,对吗?我检查了产品ID,它与我在itunes connect中的产品ID匹配。已检查捆绑包标识符,并且该标识符也匹配。。是的,我在一台设备上测试了这个
更新:
我查了一下电话号码
response.invalidProductIdentifier
它返回了我试图获取的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**
为了让IAP运行,我是否应该让付费合同生效?参考您的帖子: •您在提出SKProductRequest时是否使用完整的产品ID? 例如:com.company.sampleapp.productid是 实际上,您需要准确地指定您在iTunes Connect中输入的字符串(productId)作为应用内购买项目。因此,如果指定了
productId
,则SKProductRequest需要精确设置该字符串(不带任何com.a.b.)。如果您在iTunes中指定了类似于com.a.b.item
(推荐)的内容,则您需要在产品请求中完整设置这些内容
编辑
文章指出,付费应用合同必须生效,才能允许应用内购买。因此,这可能是您的问题的原因。我也有同样的问题,请通过以下方式解决:
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse)
注意:在完成上述步骤之前,我可以在上述委托方法的SKProductsResponse.invalidProductIdentifiers列表中看到我的产品id 您是否得到任何响应对象或其值为空?希望这能对你有所帮助。我收到了回复。你等得够久了吗?有时,新产品可能需要几个小时才能出现。是的,我在上面更新了帖子。可能的合同副本必须有效,如张贴在这里的一样。谢谢。这是我的问题。我假设itunesconnect为您添加com.a.b。你的产品id正是你在产品列表中看到的。非常感谢马库斯,你让我开心:)