Phonegap(3.0.0) Camera not successful on first try

前端 未结 6 2187
温柔的废话
温柔的废话 2021-02-15 17:21

For testing purposes I copied the full example found on the phonegap camera API and I put an alert on onPhotoDataSuccess to test when the function is fired. On the

6条回答
  •  Happy的楠姐
    2021-02-15 17:42

    I don't know whether this is right solution or not but its work for me perfectly. It would be batter to trace your log cat and found exact issue.

    Try to use navigator.camera.PictureSourceType instated of pictureSource. so it looks like


    and same way replace in Javascript code as well

    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: navigator.camera.DestinationType.FILE_URI });
    

    OR

    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: navigator.camera.DestinationType.DATA_URI });
    

    Update: Try to save your corodova.js locally and call from local dir, so your dir should like

    assets/www/js/cordova.js

    
    

    Working Code

    Hope this will help you !!!

提交回复
热议问题