zoukankan      html  css  js  c++  java
  • IOS从一个APP跳到另一个APP

    以下为跳转到大众点评APP代码如下:

    NSString *requestUrlString = @"dianping://shopinfo?id=1000";        
    NSURL *requestUrl = [NSURL URLWithString: requestUrlString]; if([[UIApplication sharedApplication] canOpenURL:requestUrl]) { [[UIApplication sharedApplication] openURL:requestUrl]; } else { //没有安装应用,默认打开HTML5站 NSString *keywords = [@"吃饭饭" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; requestUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://m.dianping.com/shoplist/219/search?from=m_search&keyword=%@",keywords]]; [[UIApplication sharedApplication] openURL:requestUrl]; }

     跳转的过程中可能会出现ERROR:

    error: "This app is not allowed to query for scheme dianping"

    解决方法是在info.plist文件内添加以下配置项,将其列为白名单才可以正常检查是否已经安装此程序。

    <key>LSApplicationQueriesSchemes</key>

    <array>

            <string>weixin</string>

            <string>wechat</string>

            <string>dianping</string>

    </array>

  • 相关阅读:
    Strust2学习笔记
    EL与OGNL区别
    十进制与其他进制转换
    JSTL
    <jsp:include>和<%@include%>区别
    AngularJS 内置过滤器
    ubuntu下swift安装
    ubuntu下gerrit 安装部署
    java日期操作
    SpringMVC GET请求中文数据传递到Server端乱码
  • 原文地址:https://www.cnblogs.com/foxting/p/5745044.html
Copyright © 2011-2022 走看看