From a3674fa62b9903f30359b55d671af64c743d7500 Mon Sep 17 00:00:00 2001 From: Vinod Prajapati Date: Mon, 4 Feb 2019 12:44:07 +0530 Subject: [PATCH 1/3] Fixed the Android issue where webview is disabled to inject JS by default --- lib/Canvas.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Canvas.js b/lib/Canvas.js index 3b1ab26..ef35722 100644 --- a/lib/Canvas.js +++ b/lib/Canvas.js @@ -14,29 +14,27 @@ var Canvas = createReactClass({ propTypes: { style: PropTypes.object, context: PropTypes.object, - render: PropTypes.func.isRequired, - onLoad: PropTypes.func, - onLoadEnd: PropTypes.func, + render: PropTypes.func.isRequired }, render() { var contextString = JSON.stringify(this.props.context); var renderString = this.props.render.toString(); + var injectJS = "var canvas = document.querySelector('canvas');(" + renderString + ").call(" + contextString + ", canvas)"; return ( *{margin:0;padding:0;}canvas{transform:translateZ(0);}"}} + source={{html: ""}} opaque={false} underlayColor={'transparent'} style={this.props.style} javaScriptEnabled={true} + injectedJavaScript={injectJS} + mixedContentMode={'compatibility'} scrollEnabled={false} - onLoad={this.props.onLoad} - onLoadEnd={this.props.onLoadEnd} - originWhitelist={['*']} /> ); From 83d2e3a81e61021e47baad3f11d4b0f8de9b3083 Mon Sep 17 00:00:00 2001 From: Vinod Prajapati Date: Mon, 4 Feb 2019 12:48:44 +0530 Subject: [PATCH 2/3] Updated the Readme doc --- README.md | 2 -- package.json | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ae43768..8c02c23 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# THIS PROJECT IS NO LONGER MAINTAINED - # react-native-qrcode A react-native component to generate [QRcode](http://en.wikipedia.org/wiki/QR_code), not only support English. diff --git a/package.json b/package.json index c051fa9..b0b94b8 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,22 @@ { - "name": "react-native-qrcode", - "version": "0.2.7", + "name": "react-native-qrcode-render", + "version": "0.1.0", "description": "react-native qrocode generator", "main": "index.js", "repository": { "type": "git", - "url": "https://github.com/cssivision/react-native-qrcode.git" + "url": "https://github.com/vinodkumar8/react-native-qrcode.git" }, "keywords": [ "react-native", "qrcode" ], - "author": "sivision.chen ", + "author": "vinod ", "license": "MIT", "bugs": { - "url": "https://github.com/cssivision/react-native-qrcode/issues" + "url": "https://github.com/vinodkumar8/react-native-qrcode/issues" }, - "homepage": "https://github.com/cssivision/react-native-qrcode#readme", + "homepage": "https://github.com/vinodkumar8/react-native-qrcode#readme", "dependencies": { "create-react-class": "^15.6.0", "prop-types": "^15.5.10", From e2f35a8f6f1318edf0fdab53b421096a6911a91b Mon Sep 17 00:00:00 2001 From: Vinod Prajapati Date: Mon, 4 Feb 2019 14:36:10 +0530 Subject: [PATCH 3/3] updated package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0b94b8..bcb2c80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-qrcode-render", - "version": "0.1.0", + "version": "0.1.1", "description": "react-native qrocode generator", "main": "index.js", "repository": {