StoreKit
2018-02-07 本文已影响128人
BoomLee
1.APP内评价
if ([UIDevice currentDevice].systemVersion.floatValue >= 10.3) {
[SKStoreReviewController requestReview];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id1347674863?action=write-review"]];
}
- 效果展示
2.APP内购买其它项目
SKStoreProductViewController *vc = [[SKStoreProductViewController alloc] init];
vc.delegate = self;
[SVProgressHUD show];
[vc loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: @(1243998293)} completionBlock:^(BOOL result, NSError * _Nullable error) {
[SVProgressHUD dismiss];
}];
[self presentViewController:vc animated:YES completion:^{
}];
#pragma mark - SKStoreProductViewControllerDelegate
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController __TVOS_PROHIBITED NS_AVAILABLE_IOS(6_0){
[viewController dismissViewControllerAnimated:YES completion:^{
}];
}
- 效果展示