Skip to content

Instantly share code, notes, and snippets.

@iksnae
Created May 2, 2014 20:57
Show Gist options
  • Save iksnae/b64437d5e7c2a7e20397 to your computer and use it in GitHub Desktop.
Save iksnae/b64437d5e7c2a7e20397 to your computer and use it in GitHub Desktop.
App Store View Controller
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