How to select multiple images in expo

Viewed 8236

I am working on react native application and I am using expo lib. I want functionality to select multiple images from gallery but I am failed because I am new to React Native . Could someone please help me how to select multiple images in expo .

code

    let result = await ImagePicker.launchImageLibraryAsync({
        mediaTypes: ImagePicker.MediaTypeOptions.All,
        quality: 1,
        allowsMultipleSelection: true,
        base64: false,
    });
3 Answers

It seems like that allowsMultipleSelection only works for web, as stated in their documentation:

allowsMultipleSelection (boolean) -- (Web only) Whether or not to allow selecting multiple media files at once.

To be able to do this on Android/iOS you probably should use this library - expo-image-picker-multiple.

For expo users, i worked in a library for this purpose... Under the hood uses expo-media-library (if you don't want use the library you can check the code to do your picker), the package is called expo-image-multiple-picker

I know this was posted a couple years ago but I just ran into this issue and luckily Expo's ImagePicker has been upgraded in SDK 46.0 to allow multi-image selection on iOS 14+, Android, and Web! To upgrade to this SDK version just follow this guide: https://blog.expo.dev/expo-sdk-46-c2a1655f63f7

I did this and am now able to use ImagePicker in my app on iOS to select multiple images at once!!

Related