简体   繁体   English

链接从iOS上的Phonegap打开位智应用

[英]Link to open waze app from phonegap on ios

I am trying to open "Waze" App when a user clicks on the below link from a Phonegap Application. 当用户单击Phonegap应用程序中的以下链接时,我试图打开“ Waze”应用程序。

It works well on android but doesn't work at all on IOS. 它在android上运行良好,但在IOS上却根本无法运行。

<a href="waze://?ll=latitude,longitude">Waze</a>

Do I need to do it differently for IOS? 我需要为iOS做不同的事情吗?

As indicated by the Waze developer documentation this is the correct URL scheme for iOS. Waze开发人员文档所述,这是适用于iOS的正确URL方案。

However, as also indicated on that page, on iOS9+ you need to whitelist the scheme in your application .plist: 但是,正如该页面上所示,在iOS9 +上,您需要在应用程序.plist中将该方案列入白名单:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>waze</string>
</array>

To do so in a Cordova app, you can either edit the plist manually in platforms/ios/MyProject/MyProject-Info.plist or use cordova-custom-config plugin to add it via a block in your config.xml : 要在Cordova应用程序中执行此操作,您可以在platforms/ios/MyProject/MyProject-Info.plist手动编辑plist,或使用cordova-custom-config插件通过config.xml的块添加它:

<platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="LSApplicationQueriesSchemes">
        <array>
            <string>waze</string>
        </array>
    </config-file>
</platform>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM