Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sharing of files from secondary storage i.e sd cards, on Android #754

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

nirre7
Copy link
Contributor

@nirre7 nirre7 commented Apr 7, 2020

Overview

Currently the Android config does not support sharing of files from secondary storage (sd cards). Developers/users have used the base64 workaround for this, but I thought it would be a good idea to support it.
Also none of these would solve it:

  <external-files-path
    name="external_files"
    path="." />
  <external-cache-path
    name="external_cache"
    path="." />
<files-path
    name="files"
    path="." />

Test Plan

On an emulator or device, download an image to the sdcard or "external storage" and then share it.

@MateusAndrade
Copy link
Collaborator

Hi @nirre7 , thanks for that! Would you mind applying these changes to the example app? Also, this shouldn't be a problem setting this key <root-path name="rnshare_sdcard" path="." /> to rnshare_sdcard?

Co-Authored-By: Mike Hardy <github@mikehardy.net>
@nirre7
Copy link
Contributor Author

nirre7 commented Apr 8, 2020

rnshare_sdcard

Afaik the name attribute "rnshare_sdcard" could be whatever as long as it is not the same as other path configs. i.e the following wouldn't work:

    <cache-path name="test" path="." />
    <root-path name="test" path="." />

@nirre7
Copy link
Contributor Author

nirre7 commented Apr 8, 2020

@mikehardy @MateusAndrade
Also thank you for reviewing this so swiftly!

@nirre7
Copy link
Contributor Author

nirre7 commented Apr 8, 2020

@MateusAndrade

Would you mind applying these changes to the example app?

Not sure what you want me to do?

  • There is nothing that needs to be done in an app that is using this lib, from a configuration perspective.
  • The example app is using a base64 image (since it is "portable") for it's examples which gets handled by a different code path in the lib.

It might be me which is misunderstanding though 🤔

@MateusAndrade
Copy link
Collaborator

It might be me which is misunderstanding though 🤔

I think i misunderstand. HAHAHA Sorry for that.

@MateusAndrade MateusAndrade merged commit df631e7 into react-native-share:master Apr 8, 2020
MateusAndrade pushed a commit that referenced this pull request Apr 8, 2020
# [3.2.0](v3.1.2...v3.2.0) (2020-04-08)

### Features

* Support sharing of files from secondary storage i.e sd cards, on Android ([#754](#754)) ([df631e7](df631e7))
@MateusAndrade
Copy link
Collaborator

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nirre7
Copy link
Contributor Author

nirre7 commented Apr 8, 2020

It might be me which is misunderstanding though 🤔

I think i misunderstand. HAHAHA Sorry for that.

Ok, td bem 👍

mobiledev7 added a commit to mobiledev7/react-native-share that referenced this pull request Dec 12, 2022
# [3.2.0](react-native-share/react-native-share@v3.1.2...v3.2.0) (2020-04-08)

### Features

* Support sharing of files from secondary storage i.e sd cards, on Android ([#754](react-native-share/react-native-share#754)) ([df631e7](react-native-share/react-native-share@df631e7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants