Share a base64 file
mainTo share a file using a base64 string, use the following URI format for the url parameter:
data:<data_type>/<file_extension>;base64,<base64_data>
Android Configuration (API 30+)
For apps targeting Android API 30 (Android 11) or higher, you must set useInternalStorage: true when sharing base64 files. This is the recommended approach for all modern Android apps.
Legacy Android (API 29 and below)
If targeting API 29 or lower, you may need to add android.permission.WRITE_EXTERNAL_STORAGE to your AndroidManifest.xml, though this is deprecated and does not work on API 30+.
// Recommended for Android API 30+
Share.open({
url: 'data:image/png;base64,<base64_data>',
useInternalStorage: true,
});