YanYuanFE / react-native-signature-canvas

:black_nib: React Native Signature Component based WebView Canvas for Android && IOS && expo
MIT License
418 stars 150 forks source link

react-native-signature-canvas can not upload signature in android #263

Open grinisoufyane opened 1 year ago

grinisoufyane commented 1 year ago

it works fine in ios, but on android, I can't draw the image, and when I try to send an image it doesn't work. "expo": "~46.0.9", "react-native": "0.69.5", "react-native-webview": "11.23.0", "react-native-signature-canvas": "^4.4.1",

serfgy commented 1 year ago

what are the errors you received?

even though sometimes the real error is not the reflected ones in the log, they do help you pinpointing the real issue

josh-thompson13 commented 1 year ago

I am having a similar issue. Works fine on IOS but it seems the onOK prop isnt being triggered on Android.

<Signature
                // backgroundColor={drawpadBackgroundColor}
                backgroundColor={drawpadBackgroundColor}
                penColor={def.atrPenColor}
                onOK={() => {
                    console.log("TAPPED");
                }}
                // onOK={saveSignature}
                onEmpty={() => console.log("empty")} // Will add engine handler here for when empty sig is saved
                descriptionText={def.labelLanguageHint}
                clearText="Clear"
                confirmText="Save"
                // String, webview style for overwrite default style, all style: https://github.com/YanYuanFE/react-native-signature-canvas/blob/master/h5/css/signature-pad.css
                webStyle={`.m-signature-pad--footer
                                .button {
                                background-color: ${drawpadButtonColor};
                                color: ${drawpadButtonTextColor};
                                }
                                .m-signature-pad
                                {
                                    width: 100%;
                                    height: 100%;
                                    margin-left: 0px;
                                    margin-top: 0px;
                                }`}
                autoClear={!def.atrShowImage}
                imageType={imageType}
                // dataURL prop must be prepended with 'data:image/png;base64, OR data:image/png;base64, before adding base64
                dataURL={exampleBase64}
            />