11

使用下面的代码 SKStoreProductViewController 可以呈现应用程序的描述。

当我触摸“免费”按钮时,它会显示“安装应用程序”。然后我触摸“安装应用程序”,应用程序图标内会显示一个进度条。但是,进度条会在 2-3 秒后消失,并且应用程序仍处于卸载状态。

这是我的演示应用程序。有谁知道原因?

SKStoreProductViewController *skvc = [[SKStoreProductViewController new] autorelease];
skvc.delegate = self;
NSDictionary *dict = [NSDictionary dictionaryWithObject:@"425349261" forKey:SKStoreProductParameterITunesItemIdentifier];
[skvc loadProductWithParameters:dict completionBlock:nil];
[self presentViewController:skvc animated:YES completion:nil];
4

2 回答 2

11

问题在于您并没有真正连接到 Itunes 商店,而是特殊的沙盒商店环境。我遇到了同样的问题,您需要有一个测试帐户并使用该帐户而不是您的普通 iTunes 帐户进行购买。

这一切都在这里描述:

http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/DevelopingwithStoreKit/DevelopingwithStoreKit.html

于 2012-10-22T12:45:17.200 回答
2

当您尝试从沙盒安装应用程序时,请确保您已从当前帐户中注销。

于 2012-11-09T13:57:57.460 回答