Coder Social home page Coder Social logo

repairshopr / react-native-signature-capture Goto Github PK

View Code? Open in Web Editor NEW
962.0 21.0 513.0 1.6 MB

A simple modular component for react native (iOS) to capture a signature as an image

License: MIT License

Objective-C 42.66% JavaScript 12.03% Java 42.64% Ruby 1.87% Starlark 0.80%

react-native-signature-capture's People

Contributors

6pm avatar adba avatar amyboyd avatar friederbluemle avatar jalada avatar jedt avatar john1jan avatar katanabe avatar legend1991 avatar nikor avatar peaches avatar qimingfang avatar rmevans9 avatar spencewine avatar timothyosborn avatar tom32i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-signature-capture's Issues

saveImage method is unavailable

this.refs['sign'] gives an instance of the signature capture component as expected, but this.refs['sign'].saveImage() method is unavailable and logs as undefined.

Android support?

Hey guys, love this plugin to bits!
Any chance of one being developed for Android or know anyone who would know to develop one for Android?
Thanks

Dotted line does not expand

The dotted signature line does not expand with the width of the signature component as shown in this image.

image

Not working with React Native 0.11.0

Hello. Wondering whether you are having a problem as well. This is the Xcode error I keep getting when the React Native component is invoked...
screen shot 2015-09-23 at 10 00 58 pm 2

Portrait App

I have an app that I want keep in portrait. I was able to rotate and contain the signature component in iOS like so:

screen shot 2016-01-14 at 12 01 18 pm

The issue I'm having is with Android. When running in a Genymotion emulator, the emulator starts freaking out and rotates back and forth until it crashes. I'm guessing this has to do with the Orientation being set by react-native-signature-capture.

Is this something that could be conditional, or simply not done on the assumption the developer could set it themselves?

onSaveEvent is called n+1 times per use

I've implemented react-native-signature-panel in an app that uses the Navigator component to display it as required, and found that the onSaveEvent callback is called +1 times for each time I mount the scene.

Example code:

const React = require('react-native');
const SignatureCapture = require('react-native-signature-capture');

const {
    StyleSheet,
    View,
} = React;

var SignatureInput = React.createClass({
    componentWillUnmount () {
        console.log('UNMOUNTING');
    },
    onSave (result) {
        console.log('ONSAVE');
        this.props.onSave(result);
        this.props.navigator.pop();
    },
    render() {
        return (
            <View style={styles.view}>
                <SignatureCapture onSaveEvent={this.onSave}/>
            </View>
        );
    }
});

var styles = StyleSheet.create({
    view: {
        flex: 1
    },
});

module.exports = SignatureInput;

In the console, the first time the scene is mounted and the onSaveEvent callback fires, everything happens as expected.

The second time, however, ONSAVE is logged twice. Third time, it's logged three times. And so on.

Android installation

I'm trying to install on an existing project, and followed the instructions given. I'm running React Native 0.18.0-rc

When trying to launch the app I get the following error:

* What went wrong:
A problem occurred configuring project ':app'.
> Cannot evaluate module reactnativesignaturecapture : Configuration with name 'default' not found.

Warning when rendering component

I'm trying to integrate this component to my project and I get this warning when rendering the component:

Warning: forceUpdate(...): Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.

And the component does not render, is there something I forgot?

Error: Attempt to invoke virtual method 'int android.app.Activity.getRequestedOrientation()' on a null object reference

Exception in native call java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.getRequestedOrientation()' on a null object reference at com.rssignaturecapture.RSSignatureCaptureMainView.<init>(RSSignatureCaptureMainView.java:46) at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance(RSSignatureCaptureViewManager.java:77) at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance(RSSignatureCaptureViewManager.java:18) at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:211) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148) at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:776) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829) at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:868) at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32) at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:603) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Remove dotted line

Hello Team,

I'm using this but facing problem to remove dotted line like

image

For android and iOS both, please suggest
And also need to decode image for web module

onResetEvent

It would be great to be able to access the Reset button press and run a function.

Currently I have a hint I've added over top the signature pad (with pointerEvents='none') to help the user know what to do:

screen shot 2016-01-21 at 9 42 17 am

I remove the hint by wrapping the signature pad in a TouchableWithoutFeedback object and changing the opacity of the hint to 0 when the user starts signing.

It would be great if the hint could reappear when the user hit Reset.

Not a big deal, but could be a nice feature.

Build failed

Hello,

After linked the package, I got this error :
I'm using react-native 0.31.0, when I remove the line of my MainApplication the build is ok

capture d ecran 2016-09-06 a 14 54 03

Thanks

The signature pad is rotated

The signature pad is rotated. It is possible to rotate it with css, but then it will save the signature as rotated as well.

The signature image is not stored in the folder (Android)

After using the onSaveEvent method, the result correctly return the path and the base64 encoding, however when I navigate to the given path, the save_signature folder is empty (also the image isn't displayed in the gallery)

Using Android with RN v0.40 and component version v0.4.5

Not work after react native >= 0.28

1.React.findNodeHandle is not a function
2.getPackages() now is moved into MainApplication, there should be an activity in RSSignatureCapturePackage constructor, what should it be? new RSSignatureCapturePackage(new MainActivity())?

Latest Android version does not compile

After doing all the steps on the tutorial I run the following command: react-native run-android

I'm getting this error:

FAILURE: Build failed with an exception.

  • Where:
    Settings file 'C:\myApp\android\settings.gradle' line: 3

  • What went wrong:
    A problem occurred evaluating settings 'myApp'.

Project with path ':react-native-signature-capture' could not be found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

PS: Line 133 is compile project(':reactnativesignaturecapture')

Not seeing a xcodeproj

Following the readme instructions for installation and am not seeing the project file within the node module. Am I missing something?

Make dashed signature lines optional

Hi, I want to remove the dashed lines in the signature pad without going in to native code. Something like

<SignatureCapture
    displayDashedBorders={false}
/>

Is it doable?

Save signature as JSON

I've tried decoding the result and converting it to JSON with something similar to:

var str = btoa(result.encoded)
var json = JSON.stringify(eval("(" + str + ")"));

but have had no success getting this to work.

Is it possible to save as JSON so I can save it in Postgres on my backend?

Stroke color changing

Hi,

Is any parameter to change the stroke color?
Or how to change from the source code?

Thanks in advance

Image sporadically fails to save when using non-native buttons

I'm encountering an issue on iOS in React Native 0.38.0.

I'm finding that while the native buttons work consistently, using the saveImage method with my own buttons fails sporadically and unpredictably; sometimes it will work 3-4 times after first boot, sometimes it won't work at all. Once it has failed, it will fail every subsequent try as well, and resetImage also stops functioning as expected.

I don't know C, but I threw in some logs to try to get a sense of what was happening. The problem seems to occur in RSSignatureView/saveImage where the image apparently fails to save: isSuccess comes up null and the directory where signature.png is saved remains empty.

Happy to provide more information as necessary.

Unable to sign

Hello team,

I have installed then run my app then my screen look this.

image

And unable to sign please help and suggest me.

Not working on ios

Hi,

I was trying this component on ios simulator.
I am facing few problems here.

  1. It is not coming in the landscape mode even when I set the viewMode value to "landscape"
  2. On save or reset button click it is throwing error.

Below are the screenshots

simulator screen shot 29-nov-2016 7 42 04 pm
simulator screen shot 29-nov-2016 7 43 38 pm

Option to rotate??

Any chance we can get an option to rotate the final signature before saving??

Latest version of the example does not compile

Code issues with BuildConfig.DEBUG which is not defined as well as scope of method enclosing the call to BuildConfig

@OverRide
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

=> should be marked as "public" as required by Javac.

This being done, the example does not work on Android

Failed to bind EAGLDrawable - Cannot sign

I got this warning when I open the signature component:
Failed to bind EAGLDrawable: <CAEAGLLayer: 0x6000004326e0> to GL_RENDERBUFFER 1

I use these dependencies for my react-native project.
"react": "15.4.2", "react-native": "0.41.2"

The issue is that I can't sign on the signature component. There is no signature shown

Missing **Android** in header

Were it not pointed out to me by my colleague, I would have totally missed out on the Android support. I remember seeing the header description and moving on because I needed one that had support for both the platform (iOS & Android) but the header seemed to suggest support only for iOS.

signature-capture

"saveImageFileInExtStorage" prop doesn't work in iOS

The saveImageFileInExtStorage={false} prop should prevent the image from being saved to the file system.

This works correctly on android (see relevant code here).

However, on iOS, the value of the saveImageFileInExtStorage prop seems to be ignored. The image is saved to the file system regardless of its value. Looking at the code, there does not seem to be any conditional logic wrapping the code which saves to the file system (see relevant code here).

Android bug when trying to save blank Signature

I'm having problems when trying to save a blank signature on Android.

It either accepts the blank or returns this error:

Unrecognized signal `RESPONDER_RELEASE` or state `undefined` for Touchable responder `null`

The resetImage method does not work on iOS.

When calling the resetImage method of the component, this error is thrown:

ExceptionsManager.js:61 React.findNodeHandle is not a function

I was able to fix this by replacing React with ReactNative. But now a new error is thrown, saying:

ExceptionsManager.js:76 Argument 1 (NSInteger) of RCTUIManager.dispatchViewManagerCommand must not be null

It seems that line 76 in SignatureCapture.js (UIManager.RSSignatureView.Commands.resetImage) is returning a null value. With further inspection I found that the UIManager.RSSignatureView.Commands object itself is empty. I am running RN 0.30.0. Any ideas for what could be causing this issue?

React.findNodeHandle is not a function

On commit 321a687 imports of React and ReactNative were changed.
A fix for this might be to change line 68 in SignatureCapture.js from:
React.findNodeHandle(this)
to:
ReactNative.findNodeHandle(this)

and the same change for line 78.

Scrolling Occurs on iOS

First of all, thank you for creating such a useful package. Installation instructions were accurate, and I am getting successful builds on both iOS and Android. On Android, the SignatureCapture component is working as expected, but I am having issues with iOS. When I try to draw my signature in iOS, my screen scrolls up and down and nothing is drawn on the component.

I tried changing the styling a bit, but this doesn't resolve the issue unfortunately. Please let me know what you think, and thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.