console.log('taking pic');
Camera.getPicture({
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA,
targetWidth: 640,
correctOrientation: true
}).then((imageData) => {
imageData = "file://" + imageData
console.log(imageData);
window.resolveLocalFileSystemURL(imageData, (fileEntry) => {
console.log(fileEntry);
fileEntry.file((resfile)=>{
console.log(resfile);
var reader = new FileReader();
reader.onloadend = (evt: any) => {
var imgBlob: any = new Blob([evt.target.result], { type: 'image/jpeg' });
imgBlob.name = 'sample.jpg';
console.log('blob created0');
this.firebase.uploadPhotoFromFile(imgBlob,(snapshot)=>{
console.log(snapshot);
});
}
})
})
})
}
In the above code , everything within onloadend never gets called , and I dont get any error.Can anyone help with this?
Thanks