美文网首页
iOS App内弹出AppStore指定应用界面

iOS App内弹出AppStore指定应用界面

作者: JohnayXiao | 来源:发表于2018-11-12 08:56 被阅读19次
#import <StoreKit/StoreKit.h>

@interface PlayVC ()<SKStoreProductViewControllerDelegate>

@end
SKStoreProductViewController *appStore = [[SKStoreProductViewController alloc] init];
                appStore.delegate = self;
                // 先去跳转再去加载页面,体验感方面会好很多
                [appStore loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @"AppId"} completionBlock:^(BOOL result, NSError * _Nullable error) {
                    if (error) {
                        NSLog(@"错误 %@",error);
                    } else {
                    }
                }];
                [self presentViewController:appStore animated:YES completion:nil];

这个是直接跳转到AppStore中指定应用

NSURL *url = [NSURL URLWithString:DownloadUrl];
 [[UIApplication sharedApplication] openURL:url];

相关文章

网友评论

      本文标题:iOS App内弹出AppStore指定应用界面

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