1. 程式人生 > >IOS跳轉到AppStore應用詳情頁面方法

IOS跳轉到AppStore應用詳情頁面方法

SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewControlleralloc] init];//設定代理請求為當前控制器本身storeProductViewContorller.delegate = self;//載入一個新的檢視展示[storeProductViewContorller loadProductWithParameters: //appId唯一的 @{SKStoreProductParameterITunesItemIdentifier : @"1049660516"} completionBlock:^(
BOOL result, NSError *error) { //block回撥if(error){ NSLog(@"error %@ with userInfo %@",error,[error userInfo]); }else{ //模態彈出appstore [self presentViewController:storeProductViewContorller animated:YES completion:^{ } ]; } }]//取消按鈕監聽- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{ [
self dismissViewControllerAnimated:YES completion:^{ }];}