RepairShopr / react-native-signature-capture

A simple modular component for react native (iOS) to capture a signature as an image
MIT License
962 stars 513 forks source link

Upload image to server PathName Android Network Error #123

Open i3IGm opened 6 years ago

i3IGm commented 6 years ago

{type: "image/jpeg", name: "signature", uri: "file:///storage/emulated/0/saved_signature/signature.png"}

chevol commented 6 years ago

I am having a similar issue, the image is just nowhere locally. Does your image actually reside in that folder or is it not there by chance?

JoseVf commented 6 years ago

Same issue here, but just happens on Android devices, iOS works as expected.

chevol commented 6 years ago

Hey JoseVF, I ended up getting it to work but I had to do the following: Add this Prop to SignatureCapture saveImageFileInExtStorage Then have some way to specify the file location on different platforms like this: const $imgUri = Platform.OS === 'android' ? 'file://' + result.pathName : result.pathName;

That is important since Android is looking for files at 'file://' vs just the path on iOS. I hope this helps, let me know if you are still running into issues.

JoseVf commented 6 years ago

Sure, as this comment said...

chevol commented 6 years ago

Yes, exactly that. That is where I got it from and it helped me out, sorry was at work and didn't bother to look for where I got the solution from.

kirandesai303 commented 4 years ago

+1 Its not work for me Did you get any other solution?

Mkay4real commented 2 years ago

Hey JoseVF, I ended up getting it to work but I had to do the following: Add this Prop to SignatureCapture saveImageFileInExtStorage Then have some way to specify the file location on different platforms like this: const $imgUri = Platform.OS === 'android' ? 'file://' + result.pathName : result.pathName;

That is important since Android is looking for files at 'file://' vs just the path on iOS. I hope this helps, let me know if you are still running into issues.

Great! This works