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>

  • 相关阅读:
    winfrom 对话框
    容器控件
    简单记事本整理
    公共控件
    winfrom。布局
    ado 小测试
    ado.not--更改精简练习
    ado.not--数据库防字符串注入攻击学习及 练习
    ado.not--练习题
    ado.not--添加练习题
  • 原文地址:https://www.cnblogs.com/foxting/p/5745044.html
Copyright © 2011-2022 走看看