{"id":20198565,"url":"https://github.com/eclipsesource/tabris-plugin-barcode-scanner","last_synced_at":"2025-04-10T10:53:45.746Z","repository":{"id":57143488,"uuid":"120446240","full_name":"eclipsesource/tabris-plugin-barcode-scanner","owner":"eclipsesource","description":"A barcode scanner plugin for Tabris.js","archived":false,"fork":false,"pushed_at":"2025-01-22T07:20:01.000Z","size":181,"stargazers_count":14,"open_issues_count":2,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-24T09:47:07.526Z","etag":null,"topics":["barcode","barcode-scanner","javascript","tabris","tabris-js","tabrisjs"],"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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eclipsesource.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-06T11:35:55.000Z","updated_at":"2025-01-22T07:20:02.000Z","dependencies_parsed_at":"2024-08-09T09:58:17.922Z","dependency_job_id":"aef61ec9-8b94-4f6c-b58d-6bf6f75785b6","html_url":"https://github.com/eclipsesource/tabris-plugin-barcode-scanner","commit_stats":{"total_commits":59,"total_committers":8,"mean_commits":7.375,"dds":"0.35593220338983056","last_synced_commit":"8c839243ac0db9a90d187f55f957890d3cca51cd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftabris-plugin-barcode-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftabris-plugin-barcode-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftabris-plugin-barcode-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipsesource%2Ftabris-plugin-barcode-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipsesource","download_url":"https://codeload.github.com/eclipsesource/tabris-plugin-barcode-scanner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248204871,"owners_count":21064934,"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","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":["barcode","barcode-scanner","javascript","tabris","tabris-js","tabrisjs"],"created_at":"2024-11-14T04:32:16.514Z","updated_at":"2025-04-10T10:53:45.723Z","avatar_url":"https://github.com/eclipsesource.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tabris.js Barcode Scanner Plugin\n\nA barcode scanner widget for [Tabris.js](https://tabrisjs.com), allowing to scan various types of barcodes.\n\n![barcode scanner screenshots](assets/tabris-plugin-barcode-scanner.jpg)\n\n## General usage\n\nThe plugin provides a `BarcodeScannerView` which can be embedded into the Tabris.js view hierarchy like any other view. Once embedded it shows a blank screen until the [`start()`](#startformats) method is called. At that point the device camera is displayed in the view bounds and barcode detection is activated. The [`detect`](#detect) event will fire when a barcode is detected in the camera view. The callback might fire multiple times for the same barcode. Barcode scanning continues until [`stop()`](#stop) is called which also deactivates the camera. It is recommended to stop barcode detection when not needed as it draws considerable power.\n\n## Supported barcode formats\n\nThe plugin supports the following barcode formats.\n\n| Barcode            | Name              |   iOS | Android |\n| ------------------ | :---------------: | :---: | :-----: |\n| UPC-A              | `upcA`            | ✓     | ✓       |\n| UPC-E              | `upcE`            | ✓     | ✓       |\n| Code 39            | `code39`          | ✓     | ✓       |\n| Code 39 Mod 43     | `code39Mod43`     | ✓     |         |\n| Code93             | `code93`          | ✓     | ✓       |\n| Code128            | `code128`         | ✓     | ✓       |\n| EAN-8              | `ean8`            | ✓     | ✓       |\n| EAN-13             | `ean13`           | ✓     | ✓       |\n| PDF417             | `pdf417`          | ✓     | ✓       |\n| QR                 | `qr`              | ✓     | ✓       |\n| Aztec              | `aztec`           | ✓     | ✓       |\n| Interleaved 2 of 5 | `interleaved2of5` | ✓     |         |\n| ITF14              | `itf`             | ✓     | ✓       |\n| DataMatrix         | `dataMatrix`      | ✓     | ✓       |\n| Codabar            | `codabar`         |       | ✓       |\n\n## Example\n\nThe following snippet shows how the `tabris-plugin-barcode-scanner` plugin can be used in a Tabris.js app:\n\n```javascript\nlet scanner = new esbarcodescanner.BarcodeScannerView({\n  left: 0, right: 0, top: 0, bottom: 0\n}).on('detect', (e) =\u003e console.log(`Detected ${e.format} code with data ${e.data}`))\n  .on('error', (e) =\u003e console.log(e.error))\n  .appendTo(tabris.ui.contentView);\nscanner.start(['qr', 'ean13']);\n```\nA more elaborate example can be found in the [example](example/) folder. It provides a Tabris.js project that demonstrates the various features of the `tabris-plugin-barcode-scanner` widget. Consult the [README](example/README.md) of the example for build instructions.\n\n## Integrating the plugin\nThe Tabris.js website provides detailed information on how to [integrate custom widgets](https://tabrisjs.com/documentation/latest/build#adding-plugins) in your Tabris.js app. To add the plugin to your app add the following entry in your apps `config.xml`:\n\n\n```xml\n\u003cplugin name=\"tabris-plugin-barcode-scanner\" spec=\"3.x\" /\u003e\n```\n\nTo fetch the latest development version use the GitHub URL:\n\n```xml\n\u003cplugin name=\"tabris-plugin-barcode-scanner\" spec=\"https://github.com/eclipsesource/tabris-plugin-barcode-scanner.git\" /\u003e\n```\n\n### iOS\n\nThe plugin requires key-value entry. `NSCameraUsageDescription` with description has to be added to the `Info.plist` file of your app to work correctly. Please include this configuration in your `config.xml` file.\n\n```xml\n\u003cedit-config target=\"NSCameraUsageDescription\" file=\"*-Info.plist\" mode=\"merge\"\u003e\n  \u003cstring\u003eYour custom description.\u003c/string\u003e\n\u003c/edit-config\u003e\n```\n\n## API\n\nThe widget api consists of the object `esbarcodescanner.BarcodeScannerView` with the following properties, events and methods.\n\n### Properties\n\nThe following properties can be applied in addition to the [common Tabris.js widget properties](https://tabrisjs\n.com/documentation/latest/api/Widget#properties):\n\n##### `camera` : _string_, supported values: `front`, `back`, default: `back`\n\nThe camera to use when scanning for barcodes. Has to be set in the constructor of the `BarcodeScannerView`.\n\n##### `scaleMode` : _string_, supported values: `fit`, `fill`, default: `fit`\n\nHow to scale the camera frame inside the bounds of the `BarcodeScannerView`. Setting the `scaleMode` to `fit` shows the full camera frame while potentially leaving blank space on the sides. Setting the `scaleMode` to `fill` will make the camera frame cover the view bounds while potentially clipping some of the camera frame edges.\n\n##### `active` : _boolean_, readonly\n\nCalling  [`start()`](#startformats) sets the `active` property to `true`. Calling [`stop()`](#stop) sets the `active` property to `false`. When an [`error`](#error) occurs or the widget is disposed the `active` state is also set to`false`.\n\n### Events\n\n#### `detect`\n\nFired when a barcode has been detected. The rate of `detect` events varies from platform to platform. It is very likely to receive duplicate events for the same barcode.\n\n##### Event parameter\n* `format`: _string_\n  * The format of the detected barcode\n* `data`: _string_\n  * The data contained in the barcode\n\n#### `error`\n\nFired when an error during the `BarcodeScannerView`s lifecycle happened. After an an error occurred no further [`detect`](#detect) event will be fired and the widget becomes unusable.\n\n##### Event parameter\n* `error`: _string_\n  * A message providing details about the error\n\n#### `activeChanged`\n\nFired when the [`active`](#active) state of the widget changes. Either by calling [`start()`](#startformats)/[`stop()`](#stop), receiving an [`error`](#error) event or disposing the widget.\n\n### Methods\n\n#### `start([formats])`\n\nEnables the camera and starts scanning for barcodes. When started, the barcode scanner continuously fires the [`detect`](#detect) event as soon as it finds a barcode in its view. To end barcode detection [`stop()`](#stop) should be called or the widget should be disposed. Not disabling the barcode scanner will consume a lot of unnecessary processing power. The given `formats` array can be used to narrow down the detected barcodes.\n\nExample:\n```js\nscanner.start(['qr']);\n```\n\n##### Parameter\n\n* `formats` : _string[]_\n  * The optional `formats` array allows to limit the detection of barcodes to only the given formats. The supported barcode names can be obtained from the [list of supported barcodes](#supported-barcode-formats). If `formats` is omitted all barcodes supported on the platform will be detected.\n\n#### `stop()`\n\nStops the barcode scanning and disables the camera.\n\nExample:\n```js\nscanner.stop();\n```\n\n## Compatibility\n\nCompatible with [Tabris.js 3.6.0](https://github.com/eclipsesource/tabris-js/releases/tag/v3.6.0)\n\n### Supported platforms\n\n * Android\n * iOS\n\n## Development of the widget\n\nWhile not required by the consumer or the widget, this repository provides a `project` folder that contains platform specific development artifacts. These artifacts allow to more easily consume the native source code when developing the native parts of the widget.\n\n### Android\n\nThe project provides a gradle based build configuration, which also allows to import the project into Android Studio.\n\nIn order to reference the Tabris.js specific APIs, the environment variable `TABRIS_ANDROID_PLATFORM` has to point to the Tabris.js Android Cordova platform root directory.\n\n```bash\nexport TABRIS_ANDROID_PLATFORM=/home/user/tabris-android-cordova\n```\n The environment variable is consumed in the gradle projects [build.gradle](project/android/build.gradle) file.\n\n## Copyright\n\n See [LICENSE](LICENSE) notice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipsesource%2Ftabris-plugin-barcode-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipsesource%2Ftabris-plugin-barcode-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipsesource%2Ftabris-plugin-barcode-scanner/lists"}