Dear all,
I’m facing quite a strange issue with the plugin image-picker (using ionic 3). Code is below but it’s quite simple:
let format = ‘data:image/jpeg;base64’;
let options : ImagePickerOptions = {
maximumImagesCount : 1,
outputType : 1
}
this.imagePicker.getPictures(options).then((imageData) => {
console.log(‘here we are’)
let base64Image = format + ‘,’ + imageData;
// here does something with the image
},
(err)=>{
// here deals with error
});
On Android (v6) the below code is looping inside the getPictures and I don’t see the console.log (i.e. the promise doesn’t shown). However, if I’m specifying the outputType to be 0 (file URI) then the code doesn’t loop anymore and I can see the message in the console. I have tested it on several devices and the result is always the same.
Had anyone faced that issue? Any clue on that? I had looks on the internet but couldn’t find solution so far.
The “ionic info” gives the following information:
cli packages: (my/path/)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 2.0.2
Cordova Platforms : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework : ionic-angular 3.5.2
System:
Android SDK Tools : 26.1.1
Node : v6.11.1
npm : 3.10.10
OS : macOS Sierra
Misc:
backend : pro
And “cordova plugin list” provides :
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-firebase 0.1.24 "Google Firebase Plugin"
cordova-plugin-image-picker 1.1.1 "ImagePicker"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-media-capture 1.4.3 "Capture"
cordova-plugin-screen-orientation 2.0.1 "Screen Orientation"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 “Keyboard”
{}
Thanks a lot in advances.
Cheers, Jerome.