cordova-plugin-media-capture crashes IOS 13



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

好的,这似乎是我的错误,因为它并没有真正清楚地记录下来,所以这是我为其他人解决问题的方式。在文档中,它指定您需要将其添加到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>

最新更新