1. 跳轉(zhuǎn)App Store 下載
id99637153*是app的唯一id密任,負責上架的應該都懂;現(xiàn)在哪還有低于10.0版本的手機啊缰盏,該省的則省驻债,廢話不多說形葬,直接上代碼
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/cn/app/%E4%B8%9C%E6%96%B9%E7%BE%8E%E9%A3%9F/id99637153*?mt=8"] options:@{} completionHandler:nil];
2.應用內(nèi)更新下載
導入頭文件: #import <StoreKit/StoreKit.h>
準守協(xié)議:<SKStoreProductViewControllerDelegate>
1.實現(xiàn)代理SKStoreProductViewControllerDelegate
SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
storeProductViewContorller.delegate = self;
[storeProductViewContorller loadProductWithParameters: @{SKStoreProductParameterITunesItemIdentifier : @"996371534"} completionBlock:^(BOOL result, NSError *error) {
if(error){
NSLog(@"錯誤%@",error);
}else{
//應用界面
[self.window.rootViewController presentViewController:storeProductViewContorller animated:YES completion:nil];
}
}];
//實現(xiàn)取消協(xié)議
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{
[self.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
[self disMiss];
}