NSString *str = [NSString stringWithFormat:@"%@://%@",[dic objectForKey:@"ios_url_scheme"],[dic objectForKey:@"app_bundle_id"]];
NSURL *app_url = [NSURL URLWithString:str];
BOOL hasInstalled = [[UIApplication sharedApplication] canOpenURL:app_url];
if (hasInstalled){
//说明此设备有安装app,打开APP
if (APP_Version.doubleValue <= 10) {
[[UIApplication sharedApplication] openURL:app_url];
}else{
[[UIApplication sharedApplication] openURL:app_url options:@{} completionHandler:nil];
}
}else{
//说明此设备没有安装app,跳转APP_STORE
NSString *link = [dic objectForKey:@"app_link_ios"];
if (link.length != 0) {
NSString *link_pro = [link stringByReplacingOccurrencesOfString:@"https" withString:@"itms-apps"];
if (APP_Version.doubleValue <= 10) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:link_pro]];
}else{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:link_pro] options:@{} completionHandler:nil];
}
}
}

最新文章

  1. 【原】SDWebImage源码阅读(五)
  2. iOS 学习 - 18.TextField 自定义菜单事件,复制和微信分享
  3. web测试常用的用例及知识
  4. XCode设置(怎么让代码收缩)
  5. SPOJ GSS4 Can you answer these queries IV
  6. MySql、SqlServer、Oracle 三种数据库查询分页方式
  7. Arch 安装步骤
  8. O - 覆盖的面积 - hdu 1255(求面积)
  9. WebView混合开发
  10. [国嵌笔记][013][Mini2440开发板介绍]
  11. 分别基于TensorFlow、PyTorch、Keras的深度学习动手练习项目
  12. win8.1安装win64_11gR2_database_2of2 【INS-13001]】环境不满足最低要求问题
  13. BZOJ2843 极地旅行社 LCT
  14. 今日Q群:QQ群众群友反馈问题的归纳总结
  15. 迷你MVVM框架 avalonjs 1.3.7发布
  16. &quot;characterEncoding&quot; must end with the &#39;;&#39; delimiter.
  17. 黄聪:使用Add-on SDK开发火狐扩展
  18. p2093 [国家集训队]JZPFAR
  19. CSS动画实例
  20. 【原创】ubuntu14.04 LTS系统VMware虚拟机内Windows server 2008 r2系统的网络配置

热门文章

  1. LeetCode 复制带随机指针的链表
  2. 实用的CSS3-渐变背景色
  3. jmeter 读写excel插件编写教程系列(1) -开篇
  4. WebServer Project-01-反射
  5. 从零开始学Jqueue
  6. webpack4.x的使用历程
  7. 基于LNMP架构部署wordpress
  8. 【BZOJ 3569】DZY Loves Chinese II
  9. Bribing FIPA
  10. nacos注册中心配置命名服务不生效问题