应用内打开AppStore上某个应用的下载界面--SKStoreReviewController的使用
产品设计要求是这样的:

对应的初步代码是这样的:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIImageView *imageView = [[UIImageView alloc] init];
imageView.frame = CGRectMake(, , [UIScreen mainScreen].bounds.size.width, );
imageView.image = [UIImage imageNamed:@"123.jpeg"];
[self.view addSubview:imageView];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self showStoreProductInApp:@""];
}
- (void)showStoreProductInApp:(NSString *)appID{
Class isAllow = NSClassFromString(@"SKStoreProductViewController");
if (isAllow != nil) {
SKStoreProductViewController *sKStoreProductViewController = [[SKStoreProductViewController alloc] init];
[sKStoreProductViewController setDelegate:self];
[sKStoreProductViewController.view setFrame:CGRectMake(, , [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - )];
[self.view addSubview:sKStoreProductViewController.view];
__weak typeof(self) weakSelf = self;
[sKStoreProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: appID}
completionBlock:^(BOOL result, NSError *error) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (result) {
/*
// 也可以再这里实现该界面的预加载(会先出来一个连返回按钮都没有的空白页)
[strongSelf.view addSubview:sKStoreProductViewController.view];
*/
}else{
NSLog(@"error:%@",error);
}
}];
}else{
//低于iOS6的系统版本没有这个类,不支持这个功能
NSString *string = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/xxxxxxx/app/id%@?mt=8",appID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
}
}
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
[viewController.view removeFromSuperview];
}
对应的初步效果是这样的:
(<--- iOS11以后)
(<--- iOS11之前)
后面再严格按照UE的效果进行微调设计就可以了。
应用内打开AppStore上某个应用的下载界面--SKStoreReviewController的使用的更多相关文章
- 已经上架的app(可供销售)在AppStore上搜不到的解决办法
这两天很是头大, 因为3天前手动发布的app到现在都还没在AppStore上看到,打了无数电话给苹果和发邮件给review团队. 下面说说怎么解决我们在iTunes后台看到是绿灯(可供销售)但是就是在 ...
- 如何获取AppStore上应用的ipa安装包
1.首先你得去下载一个Apple Configurator 2,我们通过这个工具来获取ipa包,从AppStore上下载安装你需要获取的App 2.连接手机,打开Apple Configurator ...
- 在app中打开appStore中其他app
var str = "https://itunes.apple.com/cn/app/zhang-jiange-hao-tou-zi-ke/id402382976?mt=8"//这 ...
- 关于wcf异常异常信息:由于内部错误,服务器无法处理该请求。有关该错误的详细信息,请打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribut
异常信息:由于内部错误,服务器无法处理该请求.有关该错误的详细信息,请打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribut ...
- 错误提示:通过 Web 服务器的身份验证的用户无权打开文件系统上的文件
//win7中iis配置好了可是网页打不开,为什么.? //错误提示:通过 Web 服务器的身份验证的用户无权打开文件系统上的文件 //解决办法1.右键单击你的网站根目录文件夹,如wwwroot文件夹 ...
- Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法。
http://fairwoodgame.com/blog/?p=38 Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法. Posted in Uni ...
- 使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件
使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件 原来的写法: <input type="file" accept="image/x-png ...
- JAVA判断是否是微信内置浏览器,是否是在微信内打开
/** * 通过请求头判断是否是微信内置浏览器,是否是在微信内打开 * @param request * @return */ @RequestMapping(value = "/hello ...
- 了解一下 Linux 上用于的 SSH 图形界面工具
如果你碰巧喜欢好的图形界面工具,你肯定很乐于了解一些 Linux 上优秀的 SSH 图形界面工具.让我们来看看这三个工具,看看它们中的一个(或多个)是否完全符合你的需求. 在你担任 Linux 管理员 ...
随机推荐
- Abaqus 粘聚力模型(Cohesive Model)
目录 1. 问题描述 2. 有限元模型建立--Cohesive单元 3. 有限元模型建立--接触方法 Abaqus提供了两种方法模拟胶结特性: 使用Cohesive单元模拟胶结,通过定义材料属性和截面 ...
- Jmeter_JsonPath 提取器
1.登录老黄历 2.提取阳历的数据,不用正则表达式提取器,因为这里是字典形式,用Json path提取器更简单 3.把提取的数据放到百度里去发送请求 4. 5. 6. 7. 8. 9.
- ASP.NET Core搭建多层网站架构【8.2-使用AutoMapper映射实体对象】
2020/01/29, ASP.NET Core 3.1, VS2019, AutoMapper.Extensions.Microsoft.DependencyInjection 7.0.0 摘要:基 ...
- Introducing .NET 5
Today, we’re announcing that the next release after .NET Core 3.0 will be .NET 5. This will be the n ...
- Spring Boot 2.x 入门前的准备-安装 Java JDK
本章节介绍在以 window7.window10 为代表的 window 和 mac book 下安装 Java 编译和开发环境JDK 1.8,在 window 上安装 Java JDK 的步骤,本章 ...
- 关于浮动&关于BFC规范&whyoverflow清除浮动
https://www.cnblogs.com/smivico/p/7656270.html 浮动 https://www.jianshu.com/p/4b93eecb090e BFC https:/ ...
- AT指令之 TCP/IP 命令
BC26 还有一组专用于 TCP 通信的 AT 指令:<BC26_TCP/IP_AT_Commands_Manual_V1.1>,之前已经有了 Socket 可以进行 TCP 通信,现在又 ...
- color转成image对象
.h //颜色转换成图片 + (UIImage *)imageFromColor:(UIColor *)color; .m //颜色转换成图片 + (UIImage *)imageFromColor: ...
- GCD的常用代码块
一.队列 1.获取全局的并发队列 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ...
- pytest框架,使用print在控制台输入
代码示例: import pytest@pytest.fixture(autouse=True,scope='session') #autouse=True,scope='session'def se ...