I'm implementing the StoreKit in-app app purchase interface and though it appears that the SKStoreProductViewController
handles landscape on iPad, it does not appear to do so for my app on iPhone (it's universal).
The interface to SKStoreProductViewController
is so limited, I don't appear to be able to manipulate the VC
in any way. Has anyone else run into this? Any work-arounds?
When I run the code that works on iPad, the SKStoreProductViewController
comes in from the left side, about an inch, and hangs out there until dismissed. It seems functional, but it messes up the VC that popped it up upon dismissal.
Here's the code:
// 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:^{
}];
}
}];
Even better, we're having the same problem on the GKHostedAuthenticateViewController
which is the viewcontroller returned from the method:
GKLocalPlayer.authenticateHandler = ^(UIViewController *loginVC, NSError *error) {};
To reiterate: both of these are in portrait mode on iPhones (but not iPads) and they force the UI to go into portrait mode. Upon returning, your app's UI is messed up.
SKStoreProductViewController
to view another iOS app in the store - theSKStoreProductViewController
doesn't really look good - there are three tabs that select the contents of the below scrollview. The scrollview does not use the full landscape width which makes it look...half-assed
, I don't think there is any other word for it. – Greeley