Created
August 5, 2022 07:12
-
-
Save vaibhavgehani/c73227f805148609df4a48721034e3dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const launchNativeImageLibrary = () => { | |
| let options = { | |
| includeBase64: true, | |
| storageOptions: { | |
| skipBackup: true, | |
| path: 'images', | |
| }, | |
| }; | |
| launchImageLibrary(options, (response) => { | |
| console.log('Response = ', response); | |
| if (response.didCancel) { | |
| console.log('User cancelled image picker'); | |
| } else if (response.errorCode) { | |
| console.log('ImagePicker Error: ', response.error); | |
| } else { | |
| const source = { uri: response.assets.uri }; | |
| console.log('response', JSON.stringify(response)); | |
| setFileData(response.assets[0].base64); | |
| setFileUri(response.assets[0].uri) | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment