【发布时间】:2011-01-16 12:42:43
【问题描述】:
我创建了带有应用内购买功能的 iPhone 应用。 现在,我正处于测试阶段。
我创建了配置文件 com.satyam.testapp 在连接的 iTunes 中,我创建了应用程序并上传了图像、屏幕截图、描述等。我还创建了两个用于应用内购买的 ID。一个是 com.satyam.testapp.book1,另一个是 com.satyam.testapp.book5
我还创建了测试帐户来验证我的应用内购买。
使用 com.stayam.testapp 我创建了开发人员测试配置文件,并在我开发的应用程序中使用它。
我在我的 iPhone 上注销了 iTunes 应用商店帐户。
现在我开始在我的 iPhone 上运行我的应用程序。它说没有物品可以购买。但它甚至没有要求我提供我必须输入测试帐户用户名和密码的凭据.....
如何调试?
这是我的代表:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *myProduct = [[NSArray alloc] initWithArray:response.products];
for(int i=0;i<[myProduct count];i++)
{
SKProduct *product = [myProduct objectAtIndex:i];
NSLog(@"Name: %@ - Price: %f",[product localizedTitle],[[product price] doubleValue]);
NSLog(@"Product identifier: %@", [product productIdentifier]);
}
for(NSString *invalidProduct in response.invalidProductIdentifiers)
NSLog(@"Problem in iTunes connect configuration for product: %@", invalidProduct);
[request autorelease];
[myProduct release];
}
【问题讨论】:
-
您的设备越狱了吗?如果是这样,您需要恢复越狱才能使 IAP 正常工作。
-
@pocjoc 当我将应用上传到应用商店时,IAP 是否可以越狱到?
-
@m1sk 是的。仅在测试环境下,InApp 无法正常工作。