如标题所示,我没有收到 SKProductsResponse 的任何回复。
我是怎么做的:
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//self.tableView.hidden = TRUE;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(productsLoaded:) name:kProductsLoadedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(productPurchased:) name:kProductPurchasedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(productPurchaseFailed:) name:kProductPurchaseFailedNotification object: nil];
Reachability *reach = [Reachability reachabilityForInternetConnection];
NetworkStatus netStatus = [reach currentReachabilityStatus];
if (netStatus == NotReachable)
{
progressHud = [InAppProgressHud showHUDAddedTo:self.navigationController.view animated:YES];
progressHud.labelText = @"Pas de connection internet";
progressHud.detailsLabelText = @"Activez votre 3G ou le WIFI et rééssayez";
//[self performSelector:@selector(dismissHUD:) withObject:nil afterDelay:3.0];
}
else
{
if ([InAppPurchaseSingleton sharedHelper].Products == nil)
{
[[InAppPurchaseSingleton sharedHelper] requestProducts];
progressHud = [InAppProgressHud showHUDAddedTo:self.navigationController.view animated:YES];
progressHud.labelText = @"Chargement...";
[self performSelector:@selector(timeout:) withObject:nil afterDelay:30.0];
}
}
}
我的要求:
-(void)requestProducts
{
self.request = [[[SKProductsRequest alloc]initWithProductIdentifiers:productIdentifiers] autorelease];
request.delegate = self;
[request start];
}
和响应回调:
-(void)productsRequest:(SKProductsRequest *)requestLocal didReceiveResponse:(SKProductsResponse *)response
{
self.products = response.products;
for (SKProduct *prod in self.Products)
{
NSLog(@"Product title: %@" , prod.localizedTitle);
NSLog(@"Product description: %@" , prod.localizedDescription);
NSLog(@"Product price: %@" , prod.price);
NSLog(@"Product id: %@" , prod.productIdentifier);
}
self.request = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:kProductsLoadedNotification object:products];
}
问题是回调从未被调用,我没有得到响应,没有任何反应。我什至没有收到错误日志,什么都没有=(
-> 我知道网络连接没问题
-> 我在 ios 5.1 模拟器上尝试过,并且在设备上尝试过,两者的结果相同
-> 我已从 iTunes 连接注销
->我的应用程序BundleId:fr.eamdev.testapp
->版本:0.2 准备上传
->我有 3 个 IAP:fr.eamdev.testapp.package_1、fr.eamdev.testapp.package_2、fr.eamdev.testapp.package_3 // 非消耗品 // 可出售:是 // 准备提交
有人知道吗,我在这里很绝望 TT.TT 所以你知道我已经通过了 Troy Brant 的应用内购买:完整演练和 Ray Wenderlich 的教程