Cordova相机插件不要求在iOS中获得许可

时间:2019-12-16 18:02:41

标签: ios cordova cordova-plugins cordova-plugin-camera

我正在尝试从cordova-plugin-camera访问摄像机 以下是info.plist的代码和屏幕截图

<button id = "cameraTakePicture">TAKE PICTURE</button>
<img id = "myImage"></img>

<script>

       document.getElementById("cameraTakePicture").addEventListener 
       ("click", cameraTakePicture);
    function cameraTakePicture() { 
       navigator.camera.getPicture(onSuccess, onFail, {  
          quality: 50, 
          destinationType: Camera.DestinationType.DATA_URL 
       });  

       function onSuccess(imageData) { 
          var image = document.getElementById('myImage'); 
          image.src = "data:image/jpeg;base64," + imageData; 
       }  

       function onFail(message) { 
          alert('Failed because: ' + message); 
       } 
    }

<script>

info.plist

0 个答案:

没有答案