RepairShopr / react-native-signature-capture

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

Get encoded signature without saving it #72

Open the-mold opened 7 years ago

the-mold commented 7 years ago

Guys, awesome job with the library!

is there a way how i can get encoded signature(base64) without this.sign.saveImage()? Because when i call then image disappears from the touch pad.

please let me know. thanks!

ghost commented 7 years ago

By encoded signature, you mean the base64 of it ?

the-mold commented 7 years ago

@UnSimpleGeek exactly! is there a way?

updated my question.

john1jan commented 7 years ago

what is your issue ? Getting Base64 or Image getting disappeared from touch pad ?

ghost commented 7 years ago

@petromoldovan I'm not sure to understand your question properly.

If you want to have the base64 of your signature you must use the result.encoded function.

Documentation :

_onSaveEvent(result) {
    //result.encoded - for the base64 encoded png
    //result.pathName - for the file path name
    console.log(result);
}
jebora commented 7 years ago

@petromoldovan If you look in /ios/PPSSignatureView.m there's a function called signatureImage that calls [self erase]; (not sure why). If you fork the repo and make your changes and point your package link to it, that should fix your problem for you.

Here's the commit where I made that change on our repo

CliveTeow commented 6 years ago

The signature is store in the phone's storage permanently? What if after get the encoded image, I don't need it to store in the phone? How to remove it?

john1jan commented 6 years ago

make props saveImageFileInExtStorage to false

Jogayathri commented 6 years ago

i'm also stuck in same issue....After signature capture that image is not send to server..They receive empty file..Anybody having idea to rectify this error....