目前我正在开发iOS应用程序,需要在应用程序内购买。In App购买沙盒问题
正如许多教程(如:http://www.raywenderlich.com/2797/introduction-to-in-app-purchases)。我在iTunesConnect中创建了新应用程序,上传了二进制文件并拒绝了它。之后,我在应用购买产品中添加了少量功能。在下一步我加入Storekit到我的Xcode项目后,我在我的UIViewController写了这个代码:
- (void)buyPressed
{
SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObjects: @"com.mycompany.appliaction_name.levelpack",nil]];
request.delegate = self;
[request start];
NSLog(@"request started");
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *products = response.products;
for (int i=0; i<[products count]; i++)
{
SKProduct *proUpgradeProduct = [products objectAtIndex:i];
if (proUpgradeProduct)
{
NSLog(@"Valid product id: %@" , proUpgradeProduct.price);
NSLog(@"Product title: %@" , proUpgradeProduct.localizedTitle);
NSLog(@"Product description: %@" , proUpgradeProduct.localizedDescription);
NSLog(@"Product price: %@" , proUpgradeProduct.price);
NSLog(@"Product id: %@" , proUpgradeProduct.productIdentifier);
}
}
for (NSString *invalidProductId in response.invalidProductIdentifiers)
{
NSLog(@"Invalid product id: %@" , invalidProductId);
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Apple connection error!" message:nil delegate:self cancelButtonTitle:@"CLOSE" otherButtonTitles:nil];
[myAlertView show];
[myAlertView release];
}
}
我仍然收到信息,我的所有应用产品具有无效的产品ID。今天,我发现这一点:http://developer.apple.com/library/ios/#technotes/tn2259/_index.html
而且很重要的一点: “要点:在应用准备好应用程序审查批准,不上传的发展二进制到iTunes连接。如果二元出现在iTunes Connect和它。 App Review将会检查二进制文件,并可能会拒绝开发二进制文件如果您或App Review在iTunes Connect中拒绝了您最新的二进制文件,测试App Purchase将会失败在这种情况下,解决方法是上传一个没有In应用程序购买功能可以通过应用程序审查批准。一旦二进制文件获得批准,就可以使用应用内购买功能恢复测试二进制文件。“
所以我要在iTunes再次创造新的应用程序,或者我应该建立和应用程序内购买提交我的应用程序,而不当的应用程序将出现在iTunes的应用程序内购买开发新的版本?
感谢您的回答!
我知道,因此我创建了带有新标识符的新产品,但根本没有任何变化。 –
好吧,你尝试删除应用程序,再次安装,因为有时它会发生,当你可能有应用程序商店安装的应用程序,它永远不会它正确地注册StoreKit框架,所以可能是这样的原因无效的产品ID正在发生 –
是的,我试过了。当然,我也尝试注册为新用户(普通用户和测试用户)。我也尝试添加应用程序购买到我现有的应用程序和结果是完全一样的,所有itunes连接合同签署正确。任何想法? –