Created
May 2, 2014 20:57
-
-
Save iksnae/b64437d5e7c2a7e20397 to your computer and use it in GitHub Desktop.
App Store View Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SKStoreProductViewController *productVC = [[SKStoreProductViewController alloc]init]; | |
[productVC setDelegate:self]; | |
NSDictionary *productParameters = @{ SKStoreProductParameterITunesItemIdentifier : @"708802884" }; | |
[productVC loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) { | |
// | |
[self dismissViewControllerAnimated:NO completion:nil]; | |
if(error) | |
{ | |
[[[UIAlertView alloc] initWithTitle:[error localizedDescription] | |
message:nil | |
delegate:nil | |
cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil, nil] show]; | |
} | |
if (result ) | |
{ | |
[self presentViewController:productVC animated:YES completion:nil]; | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment