InAppPurchase无效的产品标识符 - 可能的原因 [英] InAppPurchase invalid product identifiers - Possible Reasons
问题描述
在我的应用内购买试验中,这是一个漫长的夜晚追逐问题,但我似乎无法解决这个问题。我的产品标识符一直作为无效的产品标识符返回。希望有人会指出它;
(使用当前的配置文件和appId,我有推送通知正常工作)
It has been a long night chasing the problem within my in-app purchase trials yet I can not seem to solve this issue.My product identifier keeps returning as "invalid product identifier". Hopefully someone will point it out; (With current provisioning profile and appId I got push notifications working)
1-生成我的应用程序ID(没有通配符) - 启用inApp购买
1- My App ID is generated (with no wildcards) - inApp purchase is enabled
2-我的IAP(应用内购买)已添加到管理您的应用内购买中并已清算销售。
2- My IAP(In-App Purchase) is added in "Manage your in-app purchases" and cleared for sale.
3-我的IAP是在24小时前添加的(可能还需要几个小时)并处于等待审核状态
3- My IAP is added 24 hours ago ( maybe couple of hours more) and is in "Waiting For Review" state
4-我的应用程序本身被开发者拒绝>并且状态为准备上传,应用程序内购买已添加到应用程序中。
4- My App itself is developer rejected > and it is state "ready to upload", in-app purchase is added to the App.
5-我的手机未被越狱(至少没有再也没办法了。)
5- My phone is not jailbroken (at least not anymore, didn't worked either way)
6-我正在使用3GS,5.1 iOS。
6- I am working with a 3GS, 5.1 iOS.
7-我当前的配置文件是开发者配置文件而不是分发配置文件。 分发配置文件仅在上传应用程序二进制文件时使用。
7- My current provisioning profile is a "Developer Profile" not a "Distribution Profile". "Distribution Profile" is used only while uploading the Application Binary.
8-我正在为iOS 5.0构建,构建配置设置为Debug。
8- I am building for iOS 5.0 and build configuration is set to Debug.
9-我现在删除了应用程序100次,字面意思。
9- I deleted the app like 100 times now, literally.
10-所有详细信息都在iTunes Connect中设置,包括银行详细信息。
10- All details are set in iTunes Connect, including bank details.
11-我创建了一个测试用户,我从设备上的设置>存储登录。
11- I have created a test user, and I logged in from "Settings > Store" on my device.
12-我的 SKProductRequest
:
SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]];
可以提供任何其他信息。
Any other information can be supplied.
推荐答案
我不知道怎么做,也不知道它是否仍然有效。但是这里有一个让我解决问题的有趣解决方案。
I don't know how, and don't know will it remain valid. But here is the interesting solution which let me solve my problem.
根据文档,SKProductRequest应该是;
According to the documentation, SKProductRequest should be;
SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]];
您的产品要求应该是这样的;
Your product request should be like this;
com.my_site.my_app.my_product
但在我的情况我只是发送了我的产品ID,就像这样工作;
but in my situation I just sent my product id, just like this and it WORKED;
解决方案#1
SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"my_product"]];
在挖掘时,我发现对于某些人来说这种符号也有效;
While digging in, I found that for some people this notation also worked;
解决方案#2
SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObjects:@"com.my_site.my_app","my_product",nil]];
我的设置没有任何问题,如果有人遇到问题,应提供上面列出的东西如果产品标识符无效,我建议他们访问Troy Brant的无效产品ID列表的原因,此处。您还可以找到有关实施和设置IAP的详细演练,此处。
There was nothing wrong with my setup, and the above listed things should be supplied, if anyone having problems with invalid product identifiers, I recommend them to visit Troy Brant's "Cause of Invalid Product ID's List", here . Also you can find his detailed walkthrough about implemeting and setting up IAP, here.
如果你绝望,我强烈建议你尝试这两种解决方案,它们可以让你免于数小时的挫折。
If you get desperate, I strongly recommend you to try both solutions, and they can save you from hours of frustration.
这篇关于InAppPurchase无效的产品标识符 - 可能的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!