我正在实现 StoreKit 应用内应用购买界面,虽然它似乎是SKStoreProductViewController
iPad 上的手柄景观,但对于我在 iPhone 上的应用似乎并没有这样做(它是通用的)。
界面SKStoreProductViewController
非常有限,我似乎无法以VC
任何方式操作。 有没有其他人遇到过这个?任何变通办法?
当我运行在 iPad 上运行的代码时,SKStoreProductViewController
它从左侧进来,大约一英寸,然后一直挂在那里直到被解散。它看起来很实用,但它弄乱了在解雇时弹出它的 VC。
这是代码:
// Set up the store vc (creating it if not already done)
if (self.storeVC == nil) self.storeVC = [[SKStoreProductViewController alloc] init];
self.storeVC.delegate = self;
NSDictionary *params = [NSDictionary dictionaryWithObject:appID forKey:SKStoreProductParameterITunesItemIdentifier];
// Set up a HUD in case connecting to the store takes a while
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self.storeVC loadProductWithParameters:params
completionBlock:^(BOOL result, NSError *error) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
if (result) {
[self presentViewController:self.storeVC animated:NO completion:^{
}];
}
}];
更好的是,我们在GKHostedAuthenticateViewController
哪个是从方法返回的视图控制器上遇到了同样的问题:
GKLocalPlayer.authenticateHandler = ^(UIViewController *loginVC, NSError *error) {};
重申一下:这两个都在 iPhone(但不是 iPad)上处于纵向模式,并且它们强制 UI 进入纵向模式。返回后,您的应用程序的用户界面就混乱了。