iOS 跳转到Appstore的链接及二维码
1、应用内部跳转到Appstore
1、跳转到应用详情
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id1061880281"]];
其中 @"itms-apps://itunes.apple.com/app/id1061880281"为拼接地址,1061880281为应用在Appstore注册上线时产生的唯一ID
2、跳转到评论
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=1232138855&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8"]];
注:由于iOS11对应用商店进行了重新设计,使用该链接在iOS11系统上会发现找不到应用。解决办法:判断系统版本,如果系统版本大于iOS11,跳转上1链接即可
2、扫描二维码跳转到appstore
https://itunes.apple.com/app/id1061880281 ,用这个地址生成二维码即可
但是有可能会碰到多国语言问题,你会发现在其他语言下用安卓设备扫描二维码会进入itunes,而默认展示出来的界面确是英文环境,这是你只需要在 https://itunes.apple.com/app/id1061880281 修改为如下:
例如中文:https://itunes.apple.com/cn/app/id1061880281
例如日文:https://itunes.apple.com/jp/app/id1061880281
等等...也就是在https://itunes.apple.com/后面加上国家的简写国际字符即可
3、检测新版本升级跳转到AppStore
注:这个功能只有写在应用每次启动时检测,如果在设置界面留有检测更新入口,上架时审核会被苹果拒绝,苹果是不允许在AppStore之外的方式升级的
-(void)checkVersion {
NSString *path = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",@"1061880281"];
NSURL *url = [NSURL URLWithString:path];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10];
[request setHTTPMethod:@"POST"];
NSOperationQueue *queue = [NSOperationQueue new];
[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){
NSMutableDictionary *receiveStatusDic=[[NSMutableDictionary alloc]init];
if (data) {
NSDictionary *receiveDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
if ([[receiveDic valueForKey:@"resultCount"] intValue]>0) {
[receiveStatusDic setValue:@"1" forKey:@"status"];
[receiveStatusDic setValue:[[[receiveDic valueForKey:@"results"] objectAtIndex:0] valueForKey:@"version"] forKey:@"version"];
}else{
[receiveStatusDic setValue:@"-1" forKey:@"status"];
}
}else{
[receiveStatusDic setValue:@"-1" forKey:@"status"];
}
[self performSelectorOnMainThread:@selector(receiveData:) withObject:receiveStatusDic waitUntilDone:NO];
}];
}
- (void)receiveData:(id)sender {
NSString *serverVersion = [sender objectForKey:@"version"]; //获取版本号
//获取应用当前版本
NSString *currentVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
// 服务器版本号大于当前版本号
if ([serverVersion compare:currentVersion options:NSNumericSearch] == NSOrderedDescending) {
// 有新版本,执行升级操作
} else {
// 没有检测到新版本
}
}
iOS 跳转到Appstore的链接及二维码的更多相关文章
- 链接生成二维码-PHP
原文:http://www.upwqy.com/details/20.html 链接生成二维码 首先下载phpqrcode phpqrcode.zip 我这里使用的是TP5,把下载好的类库 放入到ex ...
- Java根据链接生成二维码
Java根据链接生成二维码 相关 jar 包: core-3.1.0.jar 源码及 jar 包下载:http://files.cnblogs.com/files/liaolongjun/qrcode ...
- JS链接转换为二维码
这里用到一个JQ插件 qrcode.js 下载地址https://github.com/jeromeetienne/jquery-qrcode 先引入 <script src="j ...
- iOS - WKWebView的使用和长按手势识别二维码并保存
WKWebView的图片二维码使用: .长按手势识别二维码并保存 .识别二维码跳转;不是链接显示内容点击网址跳转 .解决url包含中文不能编码的问题 .文字带链接网址,点击跳转 .纯文本-文字html ...
- 使用python 将地址链接变成二维码
import os from MyQR import myqr myqr.run( words='https://sz.ke.com/?utm_source=baidu&utm_medium= ...
- vue把链接转二维码
使用qrcodejs2插件 1. 安装qrcodejs2:npm install qrcodejs2 --save 2. 在组件里面引入: import QRCode from 'qrcodejs2' ...
- Jenkins生成APK链接的二维码
Window环境 1.下载安装Python如3.7.5版本,安装Python到电脑上如C:\Python37,将C:\Python37,C:\Python37\Scripts添加到Path环境变量中 ...
- 把链接生成二维码 二维码中间带有logo
在工程中引入三个文件jquery.qrcode.js.qrcode.js.utf.js.其中utf.js文件是防止链接中的参数出现中文乱码现象 jquery.qrcode.js文件 function ...
- php 通过链接生成二维码,扫码支付用到
$(".good_info").on('click',function () { var id = $(this).data('id'); var string='http://q ...
随机推荐
- Codeforces 762A k-th divisor(数论)
题目链接:k-th divisor 求出N的第K大因子,满足N <= 10^15,K <= 10^9 直接暴力…… #include <bits/stdc++.h> using ...
- linux文本处理常用命令
linux文本处理常用命令 linux文本处理命令:grep.sed.printf.awk 1.grep grep的作用是按行查找字符,输出包含字符的行. #从文件查询 grep 'hello' ...
- 洛谷—— P2884 [USACO07MAR]每月的费用Monthly Expense
https://www.luogu.org/problemnew/show/P2884 题目描述 Farmer John is an astounding accounting wizard and ...
- dedecms让channelartlist标签支持currentstyle属性方
把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...
- ASP.NET Web API是如何根据请求选择Action的?[上篇] 【转】
http://www.cnblogs.com/leo_wl/p/3316548.html ASP.NET Web API是如何根据请求选择Action的?[上篇] Web API的调用请求总是针对定义 ...
- osgcuda 【转】
原文 : http://blog.sina.com.cn/s/blog_df1b276a0101inbi.html osgCompute是对代码的并行流处理器执行的抽象基库.库连接到OSG的(OSG) ...
- 控制面板的cpl程序列表
控制面板的cpl程序列表 学习了:https://zhidao.baidu.com/question/2141898537654796628.html 最近用来sysdm.cpl: 辅助功能选项:ac ...
- Linux下防火墙iptables用法规则详及其防火墙配置
转:http://www.linuxidc.com/Linux/2012-08/67952.htm iptables规则 规则--顾名思义就是规矩和原则,和现实生活中的事情是一样的,国有国法,家有家规 ...
- 第十二题 Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume th ...
- 常见函数strlen、strcmp、strstr原型实现
数组元素的结束符为'\0'.串的结束符为NULL 一.strlen #include <iostream> using namespace std; long h_strlen(const ...