Jac*_*ble 15 in-app-purchase ios
我正在尝试按照此处描述的技术将应用内购买添加到我的应用中:
我通过itunes connect添加了一个产品,其ID设置如下:
com.mycompany.myapp.myproduct1
Run Code Online (Sandbox Code Playgroud)
bundle id(在p-list和app store中指定)设置如下:
com.mycompany.myapp
Run Code Online (Sandbox Code Playgroud)
我正在使用教程IAHelper中的助手类来处理购买功能(相关代码如下所示).它还有一个子类,主要用于将应用内产品的ID添加到IAHelper的产品ID数组中.
为了测试代码,我创建了一个标有"show products"的按钮,它调用了这个方法:
- (IBAction) showProducts {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(productsLoaded:) name:kProductsLoadedNotification object:nil];
Reachability *reach = [Reachability reachabilityForInternetConnection];
NetworkStatus netStatus = [reach currentReachabilityStatus];
if (netStatus == NotReachable) {
NSLog(@"No internet connection!");
} else {
if ([InAppMyAppAPHelper sharedHelper].products == nil) {
// here's where it calls the helper class method to request the products
[[InAppMyAppAPHelper sharedHelper] requestProducts];
self.hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
_hud.labelText = @"Loading vocabulary...";
[self performSelector:@selector(timeout:) withObject:nil afterDelay:30.0];
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是从iTunesConnect请求产品的方法,如上所述:
- (void)requestProducts {
self.request = [[[SKProductsRequest alloc] initWithProductIdentifiers:_productIdentifiers] autorelease];
_request.delegate = self;
[_request start];
}
Run Code Online (Sandbox Code Playgroud)
(注意,前面带有"_"的变量是指同一个名称的实际变量,每个几个合成语句都是下划线)
最后,这是在收到响应时得到通知的方法(在IAHelper中):
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
NSLog(@"IAHelper, received products results...");
self.products = response.products;
self.request = nil;
// Here's the loop to list the products received
for (id product in _products){
NSLog(@"IAHelper, received product is: %@", product);
}
[[NSNotificationCenter defaultCenter] postNotificationName:kProductsLoadedNotification object:_products];
}
Run Code Online (Sandbox Code Playgroud)
在上面,日志语句显示调用该方法,但打印接收产品的循环不会列出任何内容.
所以它看起来好像没有在iTunes连接中找到产品.然而,我在那里设置了一个产品,产品的ID与捆绑ID相同,加上产品标识符,即
bundle id: com.mycompany.myapp
product id: com.mycompany.myapp.product1
Run Code Online (Sandbox Code Playgroud)
我已经多次检查过了.
我注意到iTunes将广告产品的状态列为"准备提交".我需要做一个额外的步骤才能使它可用吗?
总的来说,我做错了什么?
tig*_*ero 39
我遇到了类似的问题.以下是在阅读Apple的技术说明后需要解决/检查的一些步骤:
正如官方文档所述,没有必要提交二进制文件既不提交应用程序内购买的截图.我在各种博客上看到了很多关于这方面的误导性信息.
检查完您已解决此列表中的每个点后,删除您的应用并重新安装.
我基本上错过了两件事:正确设置我的ios付费应用程序合同,而我没有在我的设备上安装新的配置文件.可能那是你的问题?
Jac*_*ble -1
我想我可能在这里找到了答案。
\n应用内购买网页上的这段话让我想到了这一点:
\n\n\n应用程序的首次应用内购买必须在您提交应用程序版本的同时提交以供审核。您必须在“版本详细信息”页面上执行此操作。上传二进制文件并提交第一个应用内购买以供审核后,可以使用下表提交其他应用内购买。
\n
如果您在未测试应用内购买代码的情况下不想提交应用程序进行审核,那么您可以采取的方法是提交应用程序进行审核,然后立即自行拒绝。这使其处于“开发人员拒绝”状态。
\n然后你可以添加你的产品,根据博客,
\n\n\n保存产品后,只需选择 \xe2\x80\x9cSubmit with app binary\xe2\x80\x9d 选项即可。这会将产品与应用程序二进制文件绑定在一起,因此当您最终提交 100% 完整的应用程序二进制文件时,产品也将被提交。
\n
| 归档时间: |
|
| 查看次数: |
21126 次 |
| 最近记录: |