cordova - Phonegap config.xml - 无法解释的意图

标签 cordova

Phonegap/Cordova documentation总的来说,在解释 config.xml 文件中各种意图和其他位的目的方面做得很好。但是,我一直无法确定以下内容的含义/用法

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

我将非常感谢任何能够解释他们打算做什么的人。

最佳答案

来自 whitelist plugin documentation :

Intent Whitelist

Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed.

On Android, this equates to sending an intent of type BROWSEABLE.

This whitelist does not apply to plugins, only hyperlinks and calls to window.open().



基本上,这是允许使用 window.open() 打开什么类型的 url,因此在您的示例中:
<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

该应用程序将能够在 iOS 上打开 Android Play 商店和 App 商店。链接 (market:) 将允许链接到 Play 商店中的其他应用程序(请参阅堆栈溢出问题 How to open the Google Play Store directly from my Android application?),并且 (itms:) 允许链接到 iTunes App Store 中的应用程序。如果您使用任何重定向用户安装应用程序的广告插件,这可能是必需的。这些 url 方案分别由 Google 和 Apple 在 Andriod 和 iOS 中预先注册。

关于cordova - Phonegap config.xml - 无法解释的意图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33038431/

相关文章:

android - Tap/Touch 事件不适用于 Samsung Android 4.4.4 和 5

ios - 如何使用 XCode 5 在 iOS7 上调试 cordova 应用程序

android - 使用 phonegap 从相机或图库中选择图像

android - Ionic Cordova 7.1.4 Android 构建失败

angular - IONIC/Cordova 视频流

cordova - ionic 文档扫描仪 : Incorrect result or user canceled the action

java - 针对用户偏好的phonegap Android 插件

javascript - Cordova Statusbar 插件差距

javascript - 由于异步执行 ble.scan,基于设备名称的 Cordova BLE 自动连接(无需用户操作)失败

android - Canvas 上的鼠标单击(或触摸)事件导致使用 HTML5、Phonegap 和 Android 进行选择