I changed the phonegap build version to the new cli-6.5.0.
Before, i could use camera to had picture but now, when i use camera, the app crash/refresh. I didn't change my code but it looks like it is not anymore good on android (on iphone is fine) :/
Do you have an idea of what is happening?
the code that i'm using :
config.xml
<preference name='phonegap-version' value='cli-6.5.0' />
<preference name="android-minSdkVersion" value="15" />
<preference name="android-targetSdkVersion" value="22" />
<gap:plugin name="cordova-plugin-camera" source="npm" />
the html:
<img id="myimage" src="" />
and the js :
function capturePhoto()
{
navigator.camera.getPicture(onPhotoDataSuccessAndroid, onFail, {
quality: 30,
sourceType : Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.FILE_URI
});
}
function onPhotoDataSuccessAndroid(imageURI) {
myimagetmp = document.getElementById('myimage');
myimagetmp.style.display = 'block';
myimagetmp.src = imageURI;
}
To add more indications, even if i'm using the following code, the app is still refreshing :
function capturePhoto()
{
navigator.camera.getPicture(onPhotoDataSuccessAndroid, onFail, {
quality: 30,
sourceType : Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.FILE_URI
});
}
function onPhotoDataSuccessAndroid(imageURI) {
// Nothing inside
}