{"_id":"@captureid/capacitor6-cidscan","_rev":"2-f9662c2a821ba11f02c0d6619cb4bb97","name":"@captureid/capacitor6-cidscan","dist-tags":{"latest":"1.0.70"},"versions":{"1.0.70":{"name":"@captureid/capacitor6-cidscan","version":"1.0.70","keywords":["capacitor","plugin","native"],"author":{"name":"Uwe Hoppe"},"license":"MIT","_id":"@captureid/capacitor6-cidscan@1.0.70","maintainers":[{"name":"u-hoppe","email":"u.hoppe@p4it.com"}],"homepage":"https://github.com/P4IT/capacitor-plugin-cidscan#readme","bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidscan.git/issues"},"dist":{"shasum":"4355486e3b12c40d921d373fb36416cd0ea5463c","tarball":"https://registry.npmjs.org/@captureid/capacitor6-cidscan/-/capacitor6-cidscan-1.0.70.tgz","fileCount":126,"integrity":"sha512-zk2o54LKpXb6DseeKbMPF3h/wwvsu/R3Ppu60rXSXRiorHxVFWm8+2sqMes/meHVRJObiXo8ISWAhXjdcdqEHQ==","signatures":[{"sig":"MEUCIQCSJNWElEj1IpPHRc1myaxitsYBbn85tLee7kUQ6iRDiwIgTWjBCbCEnMK7Lv5yBhp+z92RvuggJ1Wse+C7LXTjlsM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72421385},"main":"dist/plugin.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"673d89e4a0a2c410d3fa1f4bc8f9ff93b2543d8d","scripts":{"lint":"npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","prettier":"prettier \"**/*.{css,html,ts,js,java}\"","swiftlint":"node-swiftlint","prepublishOnly":"npm run build"},"_npmUser":{"name":"u-hoppe","email":"u.hoppe@p4it.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/P4IT/capacitor-plugin-cidscan.git","type":"git"},"_npmVersion":"10.7.0","description":"CaptureID Camera Scanner Plugin","directories":{},"_nodeVersion":"20.14.0","_hasShrinkwrap":false,"devDependencies":{"rimraf":"^3.0.0","rollup":"^2.21.0","prettier":"^2.0.5","swiftlint":"^1.0.1","typescript":"~3.8.3","@capacitor/ios":"^6.0.0","@capacitor/core":"^6.0.0","@capacitor/android":"^6.0.0","prettier-plugin-java":"^0.8.0","@ionic/prettier-config":"^1.0.0","@ionic/swiftlint-config":"^1.0.0","@rollup/plugin-node-resolve":"^8.1.0"},"peerDependencies":{"@capacitor/core":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor6-cidscan_1.0.70_1737541087146_0.22818352974158196","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-01-22T10:18:06.998Z","modified":"2026-09-02T06:50:00.289Z","1.0.70":"2025-01-22T10:18:08.081Z"},"bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidscan.git/issues"},"author":{"name":"Uwe Hoppe"},"license":"MIT","homepage":"https://github.com/P4IT/capacitor-plugin-cidscan#readme","keywords":["capacitor","plugin","native"],"repository":{"url":"git+https://github.com/P4IT/capacitor-plugin-cidscan.git","type":"git"},"description":"CaptureID Camera Scanner Plugin","maintainers":[{"email":"u.hoppe@p4it.com","name":"u-hoppe"},{"email":"s.hoppe@p4it.de","name":"shoppe"}],"readme":"[![appcenterbanner](https://captureid.de/wp-content/uploads/2020/03/capID.png)](https://www.captureid.de/)\r\n\r\n# Ionic Capacitor Plugin for Mobile Scan\r\n\r\nThis plugin provides the ability to use the CaptureID Scanner Library to easily integrate Camera scanning into your app(s).\r\n\r\n<!-- Capacitor Catalog -->\r\n\r\n* [Requirements](#requirements)\r\n* [How does it work?](#how-does-it-work)\r\n* [Getting Started](#getting-started)\r\n* [Plugin Usage](#plugin-usage)\r\n* [API Reference](#api-reference)\r\n* [Sample Code](#sample-code)\r\n\r\n<!-- Capacitor Catalog -->\r\n\r\n## Requirements\r\n\r\nThe CaptureID Sanner plugin expires after a 60 day evaluation period.\r\nAfter this period you must request a valid license key. This license must be purchased separatly and is not included in this package. For additional Information of the CaptureID Licensing and how to get access to a valid license Key visit our Website under ([https://www.captureid.de](https://www.captureid.de)). \r\n\r\n## How does it work?\r\n\r\nThe CaptureID Scanner Plugin can be used in Ionic Capacitor app's to support scanning functionality with the Camera of your mobile device.\r\nIt supports the most commonly used barcode symbologies.\r\n\r\n## Getting Started\r\n\r\nInstall or update the plugin into your existing project by running the command\r\n\r\n```shell\r\nnpm install capacitor-cidscan@latest\r\n```\r\nrun the build command to integrate the plugin code and it's libraries into your android project and to open the project in Android Studio\r\n\r\n```javascript\r\nionic capacitor run android\r\n``` \r\n\r\ninsert the line \"add(CIDScan.class);\" into the app's main activity file.\r\n\r\n```java\r\n  public void onCreate(Bundle savedInstanceState) {\r\n    super.onCreate(savedInstanceState);\r\n\r\n    // Initializes the Bridge\r\n    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{\r\n      // Additional plugins you've installed go here\r\n      // Ex: add(TotallyAwesomePlugin.class);\r\n      add(CIDScan.class);\r\n    }});\r\n  }\r\n\r\n```\r\n\r\n## Plugin Usage\r\n\r\nWith the CaptureID Scanner plugin installed and configured, the only thing left is to add the necessary code to your app.\r\n\r\n1. call 'initCIDScannerLib()' to initialize the plugin. This has to be done once before any other method call ech time the app starts. [see Example](#initcidscannerlib)\r\n\r\n2. Register Listeners to capture events from the Library. [see Example](#addListener)\r\n\r\n3. Call 'activateLicense(key, customer)' with the data you have received when requesting a License.\r\nThis method has to be called each time the app start's after initialization and before any other call.[see Example](#activatelicense)\r\n\r\n    To continue working with the Camera Scanner wait for the License Callback and check the result for sucessful license validation. [see Example](#samplelicresult)\r\n\r\n1. Now you can call the methods described below \r\n    \r\n## API Reference\r\n\r\n- __initCIDScannerLib()__: Promise<{}>\r\n- __closeCIDScannerLib()__: Promise<{}>\r\n- __activateLicense(options:{productkey: string, customer: string})__: Promise<{}>\r\n- __initScanner(options: {config: ScannerConfig})__\r\n- __setConfiguration(options: {config: ScannerConfig})__\r\n- __startScanner()__\r\n- __startPreview()__\r\n- __startDecode()__\r\n- __showUI(options: {show: boolean})__\r\n- __showSettings(options: {config: SannerConfig})__\r\n- __enableAllSymbologies(options: {enable: boolean})__\r\n- __enableSymbology(options: {symbology: Symbology, enable: boolean})__\r\n- __showAim(options: {style: AimStyle, color: Color, show: boolean})__\r\n- ___addListener(eventName: string, listenerFunc: (data: any) => void)__: PluginListenerHandle\r\n  \r\n\r\n### initCIDScannerLib\r\n\r\n```javascript\r\ninitCIDScannerLib();\r\n```\r\nVersion 0.1.0\r\nParameters:\r\n\r\n- __none__\r\n\r\nInitialize the Library. Must be called once each time the app starts before any other method call. When app shuts down call closeCIDScannerLib. This will release resources and safely remove all used Objects.\r\n\r\n### closeCIDScannerLib\r\n\r\n```javascript\r\nawait closeCIDScannerLib();\r\n```\r\nVersion 0.1.0\r\nParameters:\r\n\r\n- __none__\r\n\r\nClose the Library and safely release all used resources and Objects.\r\n\r\n### activateLicense\r\n\r\n```javascript\r\nawait activateLicense(key: string, customer: string);\r\n```\r\nVersion 0.1.0\r\nParameters:\r\n\r\n- __key__ *(string)* - valid Licensekey.\r\n\r\n- __customer__ *(string)* - valid CustomerId.\r\n\r\nActivate the library with the license key and customer ID provided. This method must be called every time the application is started before you can use other methods from the library.\r\n\r\n#### Note:\r\n\r\nA license key is valid for the period specified in your contract.\r\n\r\nEvaluation keys are valid for a maximum of 60 days\r\n\r\n### initScanner\r\n\r\n```javascript\r\ninitScanner(config: ScannerConfig);\r\n```\r\n\r\nParameters:\r\n\r\n- __config__ ScannerConfig.\r\n  \r\nWith this method you can initialize the camera/barcode Decoder with your individual config.\r\nIf the config \r\nYou can find a description of the configuration parameters [here](#configuration-description).\r\n\r\n\r\n  initScanner(options: {config: ScannerConfig}): void;\r\n  setConfiguration(options: {config: ScannerConfig}): void;\r\n  startScanner(): Promise<{value: DecoderStatusType;}>;\r\n  startPreview(): Promise<{value: DecoderStatusType;}>;\r\n  startDecode(): void;\r\n  showUI(options: {show: boolean}): void;\r\n  showSettings(options: {config: ScannerConfig}): void;\r\n  enableAllSymbologies(options: {enable: boolean}): void;\r\n  enableSymbology(options: {symbology: Symbology, enable: boolean}): void;\r\n  showAim(options: {aim: Aim}): void;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### enableBluetoothPrinting\r\n\r\n```javascript\r\nawait enableBluetoothPrinting(enable: boolean);\r\n```\r\nVersion 1.0.0\r\nParameters:\r\n\r\n- __enable__ *(boolean)* - Enables/disables the Printing via  Bluetooth.\r\n\r\n### getPairedDevices\r\n\r\n```javascript\r\ngetPairedDevices();\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __none__\r\n- \r\n### discoverDevices\r\n\r\n```javascript\r\ndiscoverDevices();\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __none__\r\n\r\n### printData\r\n\r\n```javascript\r\nprintData(data: string);\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __data__ *(string)* - data to be printed.\r\n\r\n### printLabelWithData\r\n\r\n```javascript\r\nprintLabelWithData(label: string, data: string[]);\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __label__: path and filename of the label template file relative to the android project assets folder.\r\n\r\n- __data[]__: array of strings representing a value for each placeholder (count and length of the array and the contained strings must match the variables in the label template)\r\n\r\n### printLabel\r\n\r\n```javascript\r\nprintLabel(label: String);\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __label__: path and filename of the label template file relative to the android project assets folder.\r\n\r\n### connectToPreferredPrinter\r\n\r\n```javascript\r\nconnectToPreferredPrinter(mac: string);\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:\r\n\r\n- __mac__: Bluetooth Mac Address of the printer to connect or an empty string. If an empty string is provided a connection to the last connected printer is established.\r\n\r\n## Sample Code\r\n\r\n### Discover printers\r\n\r\n```hint\r\nFor the sample code to work it is required to call initCIDPrinter and enableBlutoothPrinting.\r\n```\r\n\r\nRegister the callback method for the discover procedure\r\n\r\n```javascript\r\n  discoverListener = Plugins.CIDPrint.addListener(ListenerTypes.DISCOVER, (result: any) => {\r\n    let data: PrinterEvent = result.result[0];\r\n    if(data.action === PrinterActionType.LIST_PRINTER) {\r\n      this.setState({ devmac: data.device.devicemac, devname: data.device.devicename });\r\n    } else if(data.action === PrinterActionType.LIST_PRINTERS) {\r\n      this.setState({ devices: data.devices });\r\n    }\r\n  });\r\n  \r\n  discover() {\r\n    CIDPrint.discoverDevices();\r\n  }\r\n\r\n```\r\n\r\ncall discover to start the Blutooth Discover procedure.\r\n\r\nif a mobile SATO Bluetooth printer is detected the listener is invoked with a PrinterActionType of LIST_PRINTER and the Printers Mac Address and Device Name in the device field of the PrinterEvent Structure.\r\n\r\nOn finish Discover process the callback method is invoked with a LIST_PRINTERS PrinterActionType and a list of all dicovered SATO Printers is available in the devices field of the PrinterEvent Structure.\r\n\r\n\r\n## Example\r\n\r\n\r\n```javascript\r\nconst { CIDScan } = Plugins;\r\n```\r\n### addListener\r\n\r\n```javascript\r\nlicenseListener = Plugins.CIDScan.addListener(CIDScanListenerTypes.LICENSE, (result: any) => {\r\n    let data: LicenseEvent = result.result[0];\r\n    console.log(\"License Event\");\r\n    console.log(data);\r\n  });\r\n```\r\n\r\n```javascript\r\n### activateLicense\r\n\r\n\r\n    CIDScan.activateLicense({productkey: 'DvxZluDYBzqUVKNjA6TpfkNyI3YubdIpXquQ7OjqjgSkSuOXzi+LxjcpFn7hNQBwnbsHcLEsXwPqsO+VVSq315szU9389S/OYxJh9nbzyaD5VF0Qe9kbYB2ziQxOqZ++bQq5YChYFuKIGPBdP1idV9eyJbE9AX5NG6b3eYnH/+qpeGiR4esC/x65MNE76n/w4zG9O8knEY3wmrO1fu7ECZKPhyY5PizCLD/x6DFRx9/hAYM6xqUdl5K3UuA2/QXzggsr7MMMvCXiosG5XPpRis1BksMN8VXrAjyRQDJsgE9aI3AYkJn55pSWycX6dCpXMnnhj5RqKVjwjFNonKPxgjd+/fzJr/Th4j4xZGqA+PT0eJx63GbWX19gQCOegnBBihpIFXvbmCndn49FfrVVLA==', customer: 'P4I082220190001'});\r\n    CIDScan.initScanner({config: config});\r\n    CIDScan.startScanner();\r\n\r\n\r\n\r\n\r\n\r\n\r\nexport class Home extends Component {\r\n  state = {\r\n    enabled: false,\r\n    connected: false,\r\n    devname: '',\r\n    devmac: '',\r\n    devices: Array<Device>()\r\n  }\r\n  constructor(props: any) {\r\n    super(props);\r\n    this.state = { enabled: false, connected: false, devname: '', devmac: '', devices: [] };\r\n  }\r\n\r\n  discoverListener = Plugins.CIDPrint.addListener(ListenerTypes.DISCOVER, (result: any) => {\r\n    let data: PrinterEvent = result.result[0];\r\n    if(data.action === PrinterActionType.LIST_PRINTER) {\r\n      this.setState({ devmac: data.device.devicemac, devname: data.device.devicename });\r\n    } else if(data.action === PrinterActionType.LIST_PRINTERS) {\r\n      this.setState({ devices: data.devices });\r\n    }\r\n  });\r\n\r\n  printListener = Plugins.CIDPrint.addListener(ListenerTypes.PRINT, (result: any) => {\r\n    let data: PrinterEvent = result.result[0];\r\n    if(data.action === PrinterActionType.LIST_PRINTER) {\r\n      this.setState({ devmac: data.device.devicemac, devname: data.device.devicename });\r\n    } else if(data.action === PrinterActionType.LIST_PRINTERS) {\r\n      if(data.devices.length > 0) {\r\n        this.setState({ devmac: data.devices[0].devicemac, devname: data.devices[0].devicename });\r\n      }\r\n    }\r\n  });\r\n\r\n  async init() {\r\n    await CIDPrint.initCIDPrinterLib();\r\n  }\r\n\r\n  async enableBluetooth() {\r\n    this.setState({ enabled: await CIDPrint.enableBluetoothPrinting({enable: true})})\r\n  }\r\n\r\n  discover() {\r\n    CIDPrint.discoverDevices();\r\n  }\r\n\r\n  async connect(printer: Device) {\r\n    this.setState({connected: await CIDPrint.connectToPreferredPrinter({mac: printer.devicemac })})\r\n  }\r\n\r\n  async print(label: String, data: String[]) {\r\n    console.log('vorher');\r\n    await CIDPrint.printLabel({label: 'label41.dat'})\r\n    console.log('nachher');\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <IonPage>\r\n        <IonHeader>\r\n          <IonToolbar>\r\n            <IonTitle>Bluetooth Print</IonTitle>\r\n          </IonToolbar>\r\n        </IonHeader>\r\n        <IonContent fullscreen>\r\n          <IonButton onClick={() => this.init()}>Initialize Plugin</IonButton>\r\n          <IonButton onClick={() => this.enableBluetooth()}>Enable Bluetooth</IonButton>\r\n          <IonButton disabled={!this.state.enabled} onClick={() => this.discover()}>Discover Bluetooth Printer</IonButton>\r\n          <IonButton disabled={!this.state.connected} onClick={() => this.print('', ['', ''])}>Print Label</IonButton>\r\n          <IonList>\r\n             {this.state.devices.map((item) => (\r\n              <IonItem onClick={() => this.connect(item)}><IonText>{ item.devicename } -- { item.devicemac }</IonText></IonItem>\r\n            ))}\r\n           </IonList>\r\n         </IonContent>\r\n      </IonPage>\r\n    );\r\n  }\r\n}\r\n\r\nexport default Home;\r\n```\r\n\r\n\r\n## Configuration Description\r\n","readmeFilename":"README.md"}