Please refer here, Multiple image selection is not supported by react-native-image-picker for IOS.
I use react-native-image-crop-picker which supports multiple image selection for both android & ios
import ImagePicker from 'react-native-image-crop-picker';//import
ImagePicker.openPicker({
includeBase64: true, // for base 64 string
multiple: true,// To support multiple image selection
quality: 1.0,
maxWidth: 500,
maxHeight: 500,
}).then(image => {
for (i = 0; i < image.length; i++) {
this.state.images.push(image[i].data)//image[i].data=>base64 string
}
}
uploadImageToServer = () => {
this.state.images.map((data, key) => {
RNFetchBlob.fetch('POST', 'http://192.168.2.102/Project/upload_image.php', {
Authorization: "Bearer access-token",
otherHeader: "foo",
'Content-Type': 'multipart/form-data',
},
[{ name: 'image', filename: 'image.png', type: 'image/png', data: data },
{ name: 'image_tag', data: this.state.Image_TAG }]).then((resp) => {
var tempMSG = resp.data;
tempMSG = tempMSG.replace(/^"|"$/g, '');
Alert.alert(tempMSG);
}).catch((err) => {
// ...
})
})
}