-
Notifications
You must be signed in to change notification settings - Fork 343
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
How to store the screenshot? #18
Comments
you can look at RNFS is the current answer. maybe it should be in the lib as it seems to be a common requested feature, even though I would prefer to keep the lib simple. |
By the way, it looks like RNFS is getting deprecated: |
I guess we might reconsider making this a built-in feature then. user should be able to tell where he wants the image to be. one problem I see is if we use an absolute path, it will be platform dependent. I'm not sure if RN have a solution to abstract that yet. (actually I wish basic op like moving a file would be available in RN) |
we could start with a basic boolean, but I'm sure people will then ask that they want the screenshot to go in a specific folder / photo album for instance. |
It occurs to me that if the user wants a cross platform save they will have
to figure out how to choose a different path for android vs iOS as it is.
Anyway to make that easier would be welcome. It looks like
react-native-fetch-blob handles that problem by predefining some variables
with base paths in them for the user to use.
https://github.com/wkh237/react-native-fetch-blob/blob/master/README.md#user-content-dirs
It probably wouldn't be terrible to just pull in react-native-fetch-blob as
a dependency for handling this. Or giving some example of the rename code
might be just as good.
Chris
On Mon, Feb 27, 2017 at 12:57 AM Gaëtan Renaudeau <notifications@github.com> wrote:
we could start with a basic boolean, but I'm sure people will then ask that
they want the screenshot to go in a specific folder / photo album for
instance.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGWbqCZ6ZayAJU1VkTl2q5knd07Jzropks5rgo_ygaJpZM4KZrpr>
.
|
I have implemented something in branch |
I don't see any obvious issues. I might have time this evening to try and run it if you don't figure it out. |
It seems to be working for me. I made these changes to App.js in your example:
Then checked in the console output: |
yeah, it works, but can you see the picture when you browse the Photos app then? Because I can't. It seems to store it inside the (The initial request of this issue was "store to camera roll / gallery".) |
I understand what you want to do. I'm not an expert but I think you need to
use a special Api to save something to the camera roll. It's slightly
trickier because you need the users permission to save images there since
its out of the sandbox.
…On Wed, Mar 1, 2017 at 1:17 AM Gaëtan Renaudeau ***@***.***> wrote:
or like
http://stackoverflow.com/questions/4457904/iphone-how-do-i-get-the-file-path-of-an-image-saved-with-uiimagewritetosavedpho/4458451#4458451
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGWbqPQsIv4nQu0u_HmZHXrvB85RwORcks5rhTePgaJpZM4KZrpr>
.
|
I think you are right and I'll consider this to be out of scope of the library (if you need to save in cameraroll / album, use a lib that do that) I'll just merge my branch that allows to save the captured image to an absolute path (e.g. to the app's namespace folders like Document or Pictures) – you can then still retrieve it to save it somewhere else with a native module / another lib. |
hlo friends i am working on my college project , please help me i want to take a screen shot of specific part of screen like card part and then store the screen shot to image folder of project please help me . |
Is there anyway to store the screenshot to Phone's camera roll/gallery instead of the tmp directory?
The text was updated successfully, but these errors were encountered: