Image picker not showing selected image

plugins
ios

#1

Best image picker for ios? Need to pick images from gallery. I have installed image picker but its not working on ios.

this is my ccode:

const context = imagepicker.create({ mode: "single" });

    context.authorize()
    
    .then(()=> {
        return context.present();
    })
    .then((selection)=> {

        selection.forEach((selected)=> {
            // process the selected image
 
            selected.getImage().then(function(source){

                viewModel.set("selectedImage",source);  
                             
                console.log(source);  
            });
            list.items = selection;    

        });
       
    }).catch((e) =>{
        // process error
    });

image view not showing it


#2

Does console.log(source) actually log the source? If so, can you share what that selectedImage viewModel property binds to?


#3

it was my mistake, i was clearing imagesource when navigating to page

viewModel.set("selectedImage","");

i forgot when you picking image from gallery you are navigating back to page which from you opened image picker, and i was setting image source to “” when page load.