Cordova自定义URL方案不适用于IOS(不受支持的URL)

问题描述 投票:0回答:1

我正在尝试使用指向外部应用程序的深层链接,如下所示:

<Col>
              <a href="https://www.youtube.com/channel/channelname/" className="external"><img src="static/youtube.png" width='35px' alt=""/></a>
              </Col>
              <Col>
              <a href="instagram://user?username=username" className="external"><img src="static/instagram.png" width='31px' alt=""/></a>
              </Col>
              <Col>
              <a href="twitter://user?screen_name=username" className="external"><img src="static/twitter.png" width='35px' alt=""/></a>
              </Col>
              <Col>
              <a href="whatsapp://send?phone=+00000000" className="external"><img src="static/whatsapp.png" width='35px' alt=""/></a>
              </Col>

在android中工作正常,但在IOS中出现以下错误

无法加载网页,错误:URL不支持

我的config.xml文件白名单

    <allow-intent href="whatsapp:*" />
    <allow-intent href="instagram:*" />
    <allow-intent href="twitter:*" />

    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <allow-intent href="instagram:*" />    
        <allow-intent href="twitter:*" />
    </platform>

请提供任何建议..

swift xcode cordova cordova-plugins phonegap
1个回答
0
投票

您可以签出this plugin(自定义URL方案)

此插件可让您通过使用mycoolapp:// path?foo = bar之类的URL来启动应用程序

© www.soinside.com 2019 - 2024. All rights reserved.