//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的更多相关文章

  1. 跳转iPhone设置页面,绕过审核

    1.问题描述 跳转iPhone设置页面之前都是通过 App-Prefs:root=WIFI 来跳转,但是2018年6月废弃了这个函数,被认为是私有函数,审核会被拒绝. 有心人采用了字符串转码的方式来规 ...

  2. 【iOS】跳转到设置页面

    iOS8.0以后有效 定位服务 定位服务有很多APP都有,如果用户关闭了定位,那么,我们在APP里面可以提示用户打开定位服务.点击到设置界面设置,直接跳到定位服务设置界面.代码如下: 1 2 3 4 ...

  3. iOS10跳转至设置页面

    在iOS10之前,跳转到系统设置界面的某个指定界面的方式如下: //打开定位服务界面 NSURL*url=[NSURL URLWithString:@"prefs:root=Privacy& ...

  4. Android之检查网络是否可用(跳转网络设置页面)

    private boolean NetWorkStatus() { ConnectivityManager cwjManager = (ConnectivityManager) getSystemSe ...

  5. Swift - 判断是否有某功能访问权限,没有则提示,并自动跳转到设置页

    由于 iOS 系统的安全限制,App 如果需要访问设备的通讯录.麦克风. 相册. 相机.地理位置等时,需要请求用户是否允许访问.   有时用户不小心点了“不允许”,后面可能就不知道要去哪里再开启这个权 ...

  6. iOS-退出App程序,进入设置页面

     AppDelegate *app = [UIApplication sharedApplication].delegate;     UIWindow *window = app.window;   ...

  7. day105:Mofang:设置页面初始化&更新头像/上传头像&设置页面显示用户基本信息

    目录 1.设置页面初始化 2.更新头像 1.点击头像进入更新头像界面 2.更新头像页面初始化 3.更新头像页面CSS样式 4.头像上传来源选择:相册/相机 5.调用api提供的本地接口从相册/相机提取 ...

  8. iOS 从应用中跳转至系统设置页面里的多种设置页面

    我们在开发app过程中很多时候会需要设置系统权限,这时就需要在应用中跳转至系统设置页面权限设置页面,以下是自己结合网上的资料总结的一些经验: 直接从应用中跳转至系统设置中这个应用的权限设置页面 NSU ...

  9. 让超链接点击后不跳转,可以用href = "#",但是这个#就会锚点到页面最上边 点击链接后不跳转可以设置成

    让超链接点击后不跳转,可以用href = "#",但是这个#就会锚点到页面最上边     点击链接后不跳转可以设置成     1.<a href="javascri ...

随机推荐

  1. 关于PDF.NET开发框架对Mysql Sqlite PostgreSQL数据库分页支持的个人看法

    关于PDF.NET开发框架的名字由来  在设计www.pwmis.com站点的时候,考虑到架构的兼容性和将来升级的可能性,最重要的是没有足够的时间去为网站添加和维护很多复杂的程序,所以在借鉴前人成功经 ...

  2. springMVC3学习(八)--全局的异常处理

    在springMVC的配置文件中: <bean id="exceptionResolver" class="org.springframework.web.serv ...

  3. .net SoapHeader验证

    .net SoapHeader验证 在工作中经常用到webservice,在.net 开发中经常用到webservice,在java开发经常用到cxf. 今天闲置没事就介绍下 .net webserv ...

  4. 安全验证之使用摘要认证(digest authentication)

    安全验证之使用摘要认证(digest authentication) 在前一篇文章中,主要讨论了使用HTTP基本认证的方法,因为HTTP基本认证的方式决定了它在安全性方面存在很大的问题,所以接下来看看 ...

  5. Chrome插件i18n多语言实现

    i18n(其来源是英文单词 internationalization的首末字符i和n,18为中间的字符数)是“国际化”的简称.Chrome插件框架中i18n的封装API: chrome.i18n.ge ...

  6. gsoap:实现线程池处理时获取到客户端的ip

    问题: 在使用线程池处理客户端请求时发现不能获取到客户端的ip! 原因:     由于在server_loop注循环中只把连接字sock加到queue队列中,并没有客户端IP,所以每一次queue回调 ...

  7. 移植rtmpdump(librtmp)到android

    编译环境:(rtmpdump-master.zip和Polar SSL版本已经打包上传,具体路径在http://download.csdn.net/detail/gyley2/5721061) win ...

  8. ehcache.xml配置参数

    <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLoc ...

  9. java.lang.ClassNotFoundException: [Ljava.lang.String解决办法

    原来jdk5.0的时候不会报这个错,用了jdk6.0就出现了这个错误,因为没有重载java.lang.String这个类 解决方法: 在vm缺省参数里添加-Dsun.lang.ClassLoader. ...

  10. 虚拟键盘冲击移动端fixed布局的解决方案

    在做移动端业务开发时,会碰到fixed元素和输入框同时存在的情况.在手机软键盘唤起的情况下,会造成原本fixed定位的元素跟随软键盘而上浮,对整体布局造成冲击.来看这样一个栗子直观的感受一下这个bug ...