科尔多瓦-插件-媒体捕获崩溃IOS 13

时间:2019-10-15 13:15:57

标签: cordova ionic-framework media capture

我正在使用cordova-plugin-media-capture插件v3.0.3运行Ionic 3应用程序。尝试运行mediaCapture.captureAudio()时,我的应用程序崩溃,没有错误记录。还有其他人遇到这个问题吗?

1 个答案:

答案 0 :(得分:0)

好吧,这似乎是我的一个错误,因为没有真正清楚地记录在案,所以这就是我为其他人解决的问题。在文档中,它指定您需要将此文件添加到config.xml文件中以获得IOS的权限:

<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
    <string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSMicrophoneUsageDescription" file="*-Info.plist" mode="merge">
    <string>need microphone access to record sounds</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>need to photo library access to get pictures from there</string>
</edit-config>

如果您在phonegap版本上使用它,它将使ios应用程序崩溃。您需要使用以下格式:

  <config-file platform="ios" parent="NSMicrophoneUsageDescription" overwrite="true">
        <string>need microphone access to record sounds</string>
    </config-file>