美文网首页
iOS-StoreKit

iOS-StoreKit

作者: 程守斌 | 来源:发表于2017-09-26 13:04 被阅读54次

app store评价

[SKStoreReviewController requestReview];

应用内展示app store

//应用内显示其他app 下载
- (void)showAppID:(NSString *)appId{
    
    SKStoreProductViewController *product = [[SKStoreProductViewController alloc] init];
    product.delegate = self;
    __weak typeof(self) weakSelf = self;
    [product loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : appId} completionBlock:^(BOOL result, NSError * _Nullable error) {
        if (error) {
            NSLog(@"result: %d, error: %@", result, error.localizedDescription);
        } else {
            [weakSelf presentViewController:product animated:YES completion:nil];
        }
    }];
}

//回调
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [viewController dismissViewControllerAnimated:YES completion:nil];
}

相关文章

网友评论

      本文标题:iOS-StoreKit

      本文链接:https://www.haomeiwen.com/subject/vgipsxtx.html