Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic Cordova camera issue with ios 10

I am using ionic 1 with cordova-plugin-camera 2.3.0. I am using latest version of cordova.

When I press button to get image whether to use camera or gallery ($cordovaCamera.getPicture) in ios 10, nothing happens. If I press home button and go back into the app, camera or gallery pops up right away.

I have already enabled the permission for it.

This is working perfect for ios 9 and below and all android versions.

Please help.

like image 444
Kelvin Avatar asked Nov 02 '16 06:11

Kelvin


1 Answers

I confirm this is solved in Cordova app hanging during startup on iOS 10 as Sven Sönnichsen indicated in the comment to the question.

Add gap://ready file: to the Content-Security-Policy meta tag in index.html.

<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; *">

This was also addressed here: https://forums.adobe.com/thread/2211591 where Allsetra ICT said that changing the meta tag to this simple form also worked (although I did not verified it).

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
like image 194
jcarballo Avatar answered Sep 23 '22 03:09

jcarballo