Closed RohanPhpDev closed 4 years ago
I have tried this code in android 9 and its work but in android 10 I log the source and it shows null.
const context = imagepickerModule.create({ mode: 'single' // allow choosing single image }); context .authorize() .then(function() { return context.present(); }) .then(function(selection) { selection.forEach(function(selected) { selected.getImageAsync(source => { if (source) { const selectedImgSource = imageSource.fromNativeSource(source); imageCropper .show(selectedImgSource, { width: 500, height: 500 }) .then(args => { if (args.image !== null) { // Use args.image } }) .catch(function(e) { console.log(e); }); } }); }); }) .catch(function(e) { console.log(e); }); © 2020 GitHub, Inc.
@RohanPhpDev please add this to your AndroidManifest.xml's application tag,
android:requestLegacyExternalStorage="true"
Thanx shiv19 now its works.
I have tried this code in android 9 and its work but in android 10 I log the source and it shows null.
const context = imagepickerModule.create({ mode: 'single' // allow choosing single image }); context .authorize() .then(function() { return context.present(); }) .then(function(selection) { selection.forEach(function(selected) { selected.getImageAsync(source => { if (source) { const selectedImgSource = imageSource.fromNativeSource(source); imageCropper .show(selectedImgSource, { width: 500, height: 500 }) .then(args => { if (args.image !== null) { // Use args.image } }) .catch(function(e) { console.log(e); }); } }); }); }) .catch(function(e) { console.log(e); }); © 2020 GitHub, Inc.