Ionic 10的Ionic Cordova相机问题

Kel*_*vin 6 camera android ios cordova ionic-framework

我正在使用离子1与cordova-plugin-camera 2.3.0.我正在使用最新版本的cordova.

当我按下按钮获取图像是否在ios 10中使用相机或图库($ cordovaCamera.getPicture)时,没有任何反应.如果我按下主页按钮并返回应用程序,相机或画廊会立即弹出.

我已经启用了它的权限.

这适用于ios 9及以下和所有Android版本.

请帮忙.

jca*_*llo 4

我确认这个问题已在 iOS 10 启动期间挂起的 Cordova 应用程序中得到解决,正如 Sven S\xc3\xb6nnichsen 在问题评论中指出的那样。

\n\n

添加gap://ready file:到 中的 Content-Security-Policy 元标记index.html

\n\n
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; script-src &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos; *; style-src  &apos;self&apos; &apos;unsafe-inline&apos; *">\n
Run Code Online (Sandbox Code Playgroud)\n\n

这里也解决了这个问题: https: //forums.adobe.com/thread/2211591,其中 Allsetra ICT 表示将元标记更改为这种简单的形式也有效(尽管我没有验证)。

\n\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
Run Code Online (Sandbox Code Playgroud)\n