{"id":4595,"url":"https://github.com/lifuzu/ReactNativeBarcodeScanner","last_synced_at":"2025-08-04T01:32:41.560Z","repository":{"id":30641174,"uuid":"34196717","full_name":"lifuzu/ReactNativeBarcodeScanner","owner":"lifuzu","description":"Implemented a barcode scanner with support of react native technology","archived":false,"fork":false,"pushed_at":"2015-11-17T06:36:06.000Z","size":130,"stargazers_count":61,"open_issues_count":5,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-07T08:33:33.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lifuzu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-19T06:58:02.000Z","updated_at":"2021-12-17T02:38:13.000Z","dependencies_parsed_at":"2022-09-07T16:32:56.860Z","dependency_job_id":null,"html_url":"https://github.com/lifuzu/ReactNativeBarcodeScanner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lifuzu/ReactNativeBarcodeScanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifuzu%2FReactNativeBarcodeScanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifuzu%2FReactNativeBarcodeScanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifuzu%2FReactNativeBarcodeScanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifuzu%2FReactNativeBarcodeScanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifuzu","download_url":"https://codeload.github.com/lifuzu/ReactNativeBarcodeScanner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifuzu%2FReactNativeBarcodeScanner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636424,"owners_count":24282090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:17.402Z","updated_at":"2025-08-04T01:32:41.249Z","avatar_url":"https://github.com/lifuzu.png","language":"Objective-C","readme":"###Deprecated, please refer to https://github.com/lwansbrough/react-native-camera for barcode/QRcode scanner\n\n# ReactNativeBarcodeScanner\nImplemented a barcode scanner with support of react native technology\n\n## Some screen shots here:\n\n![React Native Barcode Scanner - Launcher](http://i.imgur.com/6ddBIde.png)\n![React Native Barcode Scanner - Scanning](http://i.imgur.com/6Effmbr.png)\n\n## Getting started (TBV)\n1. `npm install ReactNativeBarcodeScanner@latest --save`\n2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n3. Go to `node_modules` ➜ `ReactNativeBarcodeScanner` and add `ReactNativeBarcodeScanner.xcodeproj`\n4. In XCode, in the project navigator, select your project. Add `libReactNativeBarcodeScanner.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n5. Click `ReactNativeBarcodeScanner.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React` - mark both as `recursive`.\n5. Run your project (`Cmd+R`)\n\n## Usage\nAll you need is to `require` the `BarcodeScanner` module and then use the `\u003cBarcodeScanner/\u003e` tag.\n\n```javascript\nvar BarcodeScanner = require('./BarcodeScanner');\nvar {\n  AlertIOS,\n  AppRegistry,\n  Component,\n  NavigatorIOS,\n  StyleSheet,\n  Text,\n  TouchableHighlight,\n  View,\n} = React;\n\nvar ReactNativeBarcodeScanner = React.createClass({\n  getInitialState: function() {\n    return {\n      value: ''\n    };\n  },\n  render: function() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cTouchableHighlight onPress={this._switchCamera}\u003e\n          \u003cView\u003e\n            \u003cBarcodeScanner\n              ref=\"scanner\"\n              aspect=\"Fill\"\n              type=\"Back\"\n              orientation=\"Portrait\"\n              onScanned={this._onScannedResult}\n              style={styles.barcode}\n            /\u003e\n          \u003c/View\u003e\n        \u003c/TouchableHighlight\u003e\n        \u003cTouchableHighlight onPress={this._stopScaning}\u003e\n          \u003cText\u003eStop Scaning\u003c/Text\u003e\n        \u003c/TouchableHighlight\u003e\n        \u003cTouchableHighlight onPress={this._startScaning}\u003e\n          \u003cText\u003eStart Scaning\u003c/Text\u003e\n        \u003c/TouchableHighlight\u003e\n      \u003c/View\u003e\n    );\n  },\n  _switchCamera: function() {\n    this.refs.scanner.switch();\n  },\n  _stopScaning: function() {\n    this.refs.scanner.stopScanning();\n  },\n  _startScaning: function() {\n    this.refs.scanner.startScanning();\n  },\n  _onScannedResult: function(data) {\n    console.log(data);\n    if (this.state.value === '') {\n      this.setState({value: data});\n      AlertIOS.alert(this.state.value);\n    }\n    this.props.navigator.pop();\n  }\n});\n```\n\n------------\nThanks to Loch Wansbrough (@lwansbrough) for the `react-native-camera` module which provided me with a great example of how to set up this module.\n","funding_links":[],"categories":["Components","\u003ca name=\"Image-\u0026-Audio-\u0026-Video-\u0026-Docs:-Native-Modules\"\u003eImage, Audio, Video \u0026 Docs: Native Modules\u003c/a\u003e","Objective-C"],"sub_categories":["System"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifuzu%2FReactNativeBarcodeScanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifuzu%2FReactNativeBarcodeScanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifuzu%2FReactNativeBarcodeScanner/lists"}