Skip to content

Commit 955704d

Browse files
committed
Add docs for Android single mode.
1 parent 84c8e34 commit 955704d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Currently, [RxGalleryFinal](https://github.com/FinalTeam/RxGalleryFinal) is stil
4242
4343
```javascript
4444
import MultipleImagePicker from 'react-native-multiple-image-picker';
45+
4546
const options = {
4647
maxImagesCount: 9, // Max number of images user can select
4748
selectedPaths: [
@@ -51,5 +52,16 @@ const options = {
5152
'/Users/tshen/Library/Developer/CoreSimulator/Devices/8C416B45-F555-4A63-A1B0-09E61109F0A0/data/Containers/Data/Application/A1790255-CDE8-486C-A6BA-1693BA2AA87B/Documents/BB6ADD56-09E7-402C-BF0E-AD79400D3889-7539-000007B93A6B5733/3.jpg'
5253
] // Currently selected paths, must be from result of previous calls
5354
};
54-
MultipleImagePicker.launchImageGallery(options);
55+
MultipleImagePicker.launchImageGallery(options).then((newSelectedPaths) => {
56+
// newSelectedPaths will be an Array of String, like [ '/path/1', '/path/2' ], and may be used for `selectedPaths` on the next invocation
57+
});
58+
59+
// single mode - Android only
60+
const singleOptions = {
61+
single: true
62+
};
63+
MultipleImagePicker.launchImageGallery(singleOptions).then((path) => {
64+
// path will be a String, like 'file:///storage/sdcard/Download/IMG_0617.JPG'
65+
});
66+
5567
```

0 commit comments

Comments
 (0)