【问题标题】:How to include 'edit-config' tag of Cordova configuration in Meteor?如何在 Meteor 中包含 Cordova 配置的“edit-config”标签?
【发布时间】:2018-08-28 07:17:57
【问题描述】:

Meteor 使用 mobile-config.js 自动创建 Cordova 的 config.xml。从 iOS 10 开始,开发者必须在 Cordova 构建中由 Cordova 自己修改的 Info.plist文件中包含访问麦克风、相机、联系人等的各自原因。

我需要在 Cordova 的 config.xml 中包含以下内容以请求访问设备麦克风。

<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>need microphone access to record sounds</string>
</edit-config>

edit-config 标签是如何使用 Meteor mobile-config.js 维护的?

【问题讨论】:

    标签: android ios cordova meteor cordova-plugins


    【解决方案1】:

    我找到了解决方案。应将以下内容添加到mobile-config.js

    App.appendToConfig(`
      <edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
        <string>Need microphone access to record voice</string>
      </edit-config>
    `);
    

    如果您需要,官方documentation 中有更多关于在 Meteor 中配置插件的信息。

    【讨论】:

      猜你喜欢
      • 2018-07-05
      • 2018-06-12
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 2020-12-22
      • 1970-01-01
      • 1970-01-01
      • 2012-12-22
      相关资源
      最近更新 更多