app无法与SKStoreProductViewController一起安装

enz*_*ang 11 iphone objective-c storekit ios6

使用以下代码,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];
Run Code Online (Sandbox Code Playgroud)

Car*_*aro 11

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

这一切都在这里描述:

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

  • 一旦App在Appstore中,签名就会发生变化,这就是Apple如何知道它现在应该连接到真正的appstore.我建议您在这里找到"使用Storekit销售产品"视频:https://developer.apple.com/videos/wwdc/2012/ (2认同)