跳转到设置页面 与appstory
//MARK:系统跳到应用设置页面
func systemMySet(){
let url = NSURL(string: UIApplicationOpenSettingsURLString)
if let url = url where UIApplication.sharedApplication().canOpenURL(url) {
UIApplication.sharedApplication().openURL(url)
}
}
//跳转到系统设置的其他界面需要 在项目中的info中添加 URL types 添加 URL Schemes 为 prefs的url
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
//MARK:跳转到appstory
func appStory(){
//let url = "http://itunes.apple.com/lookup?id=1125895585"//只在国内的需要加cn
let url = "http://itunes.apple.com/cn/lookup?id=1125895585"
Prequest.requestJSON(.POST, URLString: url, completion: { (response) in
// pprintLog("response:\(response)")
let result = (response?.objectForKey("results"))! as! NSArray
pprintLog("result:\(result)")
let dic = (result.lastObject)! as! NSDictionary
let lineversion = dic.objectForKey("version") as! String
let infoDictionary = NSBundle.mainBundle().infoDictionary
let localVersion : String? = infoDictionary! ["CFBundleVersion"] as? String
if localVersion != lineversion{
let alert = UIAlertController(title: "版本更新", message: "检测到有新版本,前往appstory更新", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "取消", style: UIAlertActionStyle.Cancel) { (UIAlertAction) -> Void in
})
alert.addAction(UIAlertAction(title: "确定", style: UIAlertActionStyle.Default) { (UIAlertAction) -> Void in
//然后将 http:// 替换为 itms:// 或者 itms-apps://:
UIApplication.sharedApplication().openURL(NSURL(string: "http://iTunes.Apple.com/us/app/appid")!)
})
self.presentViewController(alert, animated: true, completion: nil)
}
}) { (failed) in
pprintLog("failed:\(failed)")
}
}
//跳转到app评论页
func appStoryComment(){
let alert = UIAlertController(title: "评价应用", message: "立刻前往appstory评价", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "稍后", style: UIAlertActionStyle.Cancel) { (UIAlertAction) -> Void in
})
alert.addAction(UIAlertAction(title: "确定", style: UIAlertActionStyle.Default) { (UIAlertAction) -> Void in
let url = NSURL.init(string: "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=appid&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8")
UIApplication.sharedApplication().openURL(url!)
})
self.presentViewController(alert, animated: true, completion: nil)
}
跳转到设置页面 与appstory的更多相关文章
- 跳转iPhone设置页面,绕过审核
1.问题描述 跳转iPhone设置页面之前都是通过 App-Prefs:root=WIFI 来跳转,但是2018年6月废弃了这个函数,被认为是私有函数,审核会被拒绝. 有心人采用了字符串转码的方式来规 ...
- 【iOS】跳转到设置页面
iOS8.0以后有效 定位服务 定位服务有很多APP都有,如果用户关闭了定位,那么,我们在APP里面可以提示用户打开定位服务.点击到设置界面设置,直接跳到定位服务设置界面.代码如下: 1 2 3 4 ...
- iOS10跳转至设置页面
在iOS10之前,跳转到系统设置界面的某个指定界面的方式如下: //打开定位服务界面 NSURL*url=[NSURL URLWithString:@"prefs:root=Privacy& ...
- Android之检查网络是否可用(跳转网络设置页面)
private boolean NetWorkStatus() { ConnectivityManager cwjManager = (ConnectivityManager) getSystemSe ...
- Swift - 判断是否有某功能访问权限,没有则提示,并自动跳转到设置页
由于 iOS 系统的安全限制,App 如果需要访问设备的通讯录.麦克风. 相册. 相机.地理位置等时,需要请求用户是否允许访问. 有时用户不小心点了“不允许”,后面可能就不知道要去哪里再开启这个权 ...
- iOS-退出App程序,进入设置页面
AppDelegate *app = [UIApplication sharedApplication].delegate; UIWindow *window = app.window; ...
- day105:Mofang:设置页面初始化&更新头像/上传头像&设置页面显示用户基本信息
目录 1.设置页面初始化 2.更新头像 1.点击头像进入更新头像界面 2.更新头像页面初始化 3.更新头像页面CSS样式 4.头像上传来源选择:相册/相机 5.调用api提供的本地接口从相册/相机提取 ...
- iOS 从应用中跳转至系统设置页面里的多种设置页面
我们在开发app过程中很多时候会需要设置系统权限,这时就需要在应用中跳转至系统设置页面权限设置页面,以下是自己结合网上的资料总结的一些经验: 直接从应用中跳转至系统设置中这个应用的权限设置页面 NSU ...
- 让超链接点击后不跳转,可以用href = "#",但是这个#就会锚点到页面最上边 点击链接后不跳转可以设置成
让超链接点击后不跳转,可以用href = "#",但是这个#就会锚点到页面最上边 点击链接后不跳转可以设置成 1.<a href="javascri ...
随机推荐
- .NET开发邮件发送功能
.NET开发邮件发送功能 今天,给大家分享的是如何在.NET平台中开发“邮件发送”功能.在网上搜的到的各种资料一般都介绍的比较简单,那今天我想比较细的整理介绍下: 1) 邮件基础理论知 ...
- 多平台Client TCP通讯组件
Beetle.NetPackage是一个多平台Client Socket TCP通讯组件(Apache License 2.0),组件制统一的对象协议制定规则,可以灵活方便地通过对象来描述TCP通讯交 ...
- vs2013安装xna4.0模板
首先需要安装Windows Phone SDK 7.1,这里面包含了最新的XNA SDK,当然也能安装其它的XNA SDK. 安装完后复制模板 xcopy /e "C:\Program Fi ...
- ckeditor:复制内容到ckeditor时,只保留文本,忽略其样式解决方法
打开ckeditor 包下的config.js,在 CKEDITOR.editorConfig= function(config){...}添加一句配置: config.forcePasteAsPla ...
- [转载]expect spawn、linux expect 用法小记
原文地址:expect spawn.linux expect 用法小记作者:悟世 使用expect实现自动登录的脚本,网上有很多,可是都没有一个明白的说明,初学者一般都是照抄.收藏.可是为什么要这么写 ...
- tag标签记录
看到项目代码中有一个自定义的tag标签,想起以前自己写过的标签,竟然忘记的差不多了,手一痒,自己写个简单的tag标签,回顾一下历史知识 首先建一个servlet工程,然后写个index.jsp,项目跑 ...
- c++字符串连接方法大观
c++字符串连接方法大观 抛砖引玉: springf(config_itemID[i],"ItemID%s_%d",i,i); 大家说说自己都用什么方法,个有什么利弊呢?
- Thymeleaf 笔记
th:each=”aname : ${namelist}” th:if=”${name} == ‘SERVICED’” 页面使用Map集合 <div th:each="osl : ${ ...
- oc之对象作为类的属性
对象做为类的属性 1. 一个Target中的类无法直接在另外1个Target中访问. 2. 类的属性代表什么? a. 类的属性代表这类事物具有的共同的特征 b. 类的属性代表这个类所拥有的东西. 灯: ...
- [ios2][转]iOS摇动检测 (UIAccelerometer)
加速计(UIAccelerometer)是一个单例模式的类,所以需要通过方法sharedAccelerometer获取其唯一的实例. 加速计需要设置的主要有两个: 一个是设置其代理,用以执行获取加速计 ...