StoreKit

作者: BoomLee | 来源:发表于2018-02-07 17:34 被阅读128次

    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:^{
            
        }];
    }
    
    • 效果展示

    相关文章

      网友评论

          本文标题:StoreKit

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