react-native-share icon indicating copy to clipboard operation
react-native-share copied to clipboard

Android WRITE_EXTERNAL_STORAGE Permission in Docs

Open bitmold opened this issue 2 months ago • 4 comments

https://react-native-share.github.io/react-native-share/docs/share-open#sharing-a-base64-file-format

According to the docs you need to add the WRITE_EXTERNAL_STORAGE permission in order to share a base64 encoded file on Android

<!-- required for react-native-share base64 sharing -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE

However for apps targeting API 30 or higher this permission does nothing. And to get your app into the play store you need to at least target APi 34, so for any play store app this permission does nothing.

This may be in part related to #1687

I recently upgraded to version 12.2.0 from 10.2.1 and noticed that base64 image sharing was broken and came across the docs linked above saying that I should be using WRITE_EXTERNAL_STORAGE. I was surprised to see that the app that I was working on did in fact declare this permission even though it does nothing and needs to be removed.

I was able to resolve my issue to share a base 64 encoded image on android after upgrading to 12.2.0 by setting useInternalStorage: true on my call to Share.open, but think that ultimately the documentation for this project should not be telling people to declare WRITE_EXTERNAL_STORAGE in 2025

bitmold avatar Nov 04 '25 04:11 bitmold

agreed - that permission is quite uncommon unless you are a file management app with exception

if you made a PR to the docs it would likely be merged, especially since you have experience in getting it working (nice!)

mikehardy avatar Nov 04 '25 13:11 mikehardy

Thanks, unfortunately I don't have time for that right now - so I was just letting the maintainers know 🤷‍♀️

But that's also not quite right - it's not that WRITE_EXTERNAL_STORAGE has become uncommon in 2025, it's that even if you're a file management apps endowed with special privileges, the system completely ignores WRITE_EXTERNAL_STORAGE for every single app running on API30+ and so declaring it does nothing whatsoever. Documentation about this permission must be leftover from a past era of Android dev and it's incorrect + misleading to keep it there today.

and that uncommon file management use case you described is now based around the newer MANAGE_EXTERNAL_STORAGE permission 😉

bitmold avatar Nov 15 '25 12:11 bitmold

I don't have time for that right now

The github web UI for a PR that is just a text change to docs takes about same amount of time as typing your comment - I mean that with no exaggeration, the biggest delay is the lag of github creating a fork (takes 30secs or so?) then you have a text area with the text. Make change. Hit commit button, hit PR button 🤷

I was just letting the maintainers know

This is an open source library for an open source framework used by developers. All developers are maintainers. You are we. We are maintainers 🧘

mikehardy avatar Nov 25 '25 19:11 mikehardy

Thank you for sharing the solution.

realstone2 avatar Nov 26 '25 07:11 realstone2