I'm using Android at the moment and developing my app with Ionic. When a user takes a photo, I'm having it append to an ion-slide in a ion-slides element. However, I keep getting "Not allowed to load local resource error." All the permissions are set (The image gets saved)
HTML:
<ion-slide *ngFor="let looImage of looImages">
<img src="{{ looImage }}" imageViewer ion-long-press
(onPressing)="showImageOptions()"/>
</ion-slide>
TS:
options: CameraOptions = {
correctOrientation: true,
quality: 50,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
capturePhoto() {
this.camera.getPicture(this.options).then((imageData) => {
this.looImages.push(imageData);
console.log(this.looImages.length);
}, (err) => {
});
}
Full error:
Not allowed to load local resource: file:///storage/emulated/0/Android/data/io.ionic.starter/cache/1538074314258.jpg