I'm trying to let user to select image from gallery on my ionic native app, code works on IOS but on android when select Choose Image nothing happend, can't see a error on logcat.
My method:
accessGallery(){
this.camera.getPicture({
sourceType: this.camera.PictureSourceType. SAVEDPHOTOALBUM,
destinationType: this.camera.DestinationType.DATA_URL,
quality: 10
}).then((imageData) => {
this.sanitizeImage('data:image/jpeg;base64,' + imageData);
}, (err) => {
console.log(err);
this.showAlert("Cannot Access Gallery", err);
});
}
Any help or suggestion would be greatly appreciated.
This works for me in Android.
The only difference is that I don't sanitize the text when I get the result.
I just do
this.myPicture = image64;
Try with that and tell me how it goes.