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

add custom file name props for android #318

Merged
merged 1 commit into from
May 28, 2022
Merged

add custom file name props for android #318

merged 1 commit into from
May 28, 2022

Conversation

LkyYuen
Copy link
Contributor

@LkyYuen LkyYuen commented Sep 7, 2020

No description provided.

@m4yer
Copy link

m4yer commented Nov 23, 2020

Would be really nice to have this one!

@gre
Copy link
Owner

gre commented Dec 29, 2020

May I know the reason why you would want to give a name to that file? It's meant to be a temporary file that you later can reuse to send to a server / send to the user as a "share" action / ...

@gre gre added the question label Dec 29, 2020
@m4yer
Copy link

m4yer commented Jan 4, 2021

May I know the reason why you would want to give a name to that file? It's meant to be a temporary file that you later can reuse to send to a server / send to the user as a "share" action / ...

For me the reason is the ability of downloading this file and it does not look good when the filename is something like "react-native......" in user's gallery.

@gre
Copy link
Owner

gre commented Jan 4, 2021

I didn't know this file would appear at all in user's phone, is it the case on Android? I thought the current folder used was invisible for the user.
The goal was always that this file is a temporary file and when you need to show that file to user, you would need to use a library like react-native-fs to move the file to a more permanent place and with a better file name.

This is specifically documented in https://github.com/gre/react-native-view-shot#saving-to-a-file

Overall i'm not sure if this is a good idea to put this in this library, it feels out of scope to me. but still open to discussion if there is no other workaround.

@juniorklawa
Copy link

juniorklawa commented Feb 23, 2021

In my case it would be nice to have the option to rename the file because I use this ViewShot capture sharing it on social networks like Instagram and WhatsApp and a name like ReactNative-snapshot is not so elegant, because before sharing an image the name of the file appears above the sharing options and in this case the image is temporary.
Example

@CanRau
Copy link

CanRau commented Mar 28, 2022

Also renaming would allow be to save it straight to MediaLibrary without the need need to [copy], move to rename and then save to media library
Though would appreciate that option for iOS as well
Till then I'm using the work around, just wanted to share my use case and thanks a lot for this package by the way 🙏

@gre
Copy link
Owner

gre commented May 28, 2022

Thanks for the PR.

@gre gre merged commit a7eae22 into gre:master May 28, 2022
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.

6 participants