{"_id":"@captureid/capacitor4-cidprint","_rev":"4-22fd37f51343e9a465d656fd60ff69f8","name":"@captureid/capacitor4-cidprint","dist-tags":{"latest":"0.0.66"},"versions":{"0.0.64":{"name":"@captureid/capacitor4-cidprint","version":"0.0.64","keywords":["capacitor","plugin","native"],"author":{"name":"Uwe Hoppe"},"license":"MIT","_id":"@captureid/capacitor4-cidprint@0.0.64","maintainers":[{"name":"u-hoppe","email":"u.hoppe@p4it.com"}],"homepage":"https://github.com/P4IT/capacitor-plugin-cidprint#readme","bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidprint.git/issues"},"dist":{"shasum":"83a2452302728607dd333672f30b3fa08ae0c712","tarball":"https://registry.npmjs.org/@captureid/capacitor4-cidprint/-/capacitor4-cidprint-0.0.64.tgz","fileCount":106,"integrity":"sha512-UGVk6NrXU3PF+5Ml8ncLOmmm7HqzWathkaRxiij3UY0x+E5z4ogYPsTPjh1WGkX/z0j42BNpnnVhNguhruzq9g==","signatures":[{"sig":"MEUCIEiDfuaJS/0D7fC+Ojt7DcmKqz0uVF/WAy8kYkbOrmaSAiEA7+DhKx/7zBrnPHsPs+AxF0v/xmflJTxbD3WtoqGnTWw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8102460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjATOEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7lBAAn+VHoX2cJ61u4rpB6fS14MOOKWG480Dwlla24RRvCQDgYpaB\r\nmfIXyoAxzPUVH2sN+0mmdyu20xWrFQD+U+TCZy5nbSZyewDTk+NGJMqu73mU\r\ngHoc9tkqwzODAaQQFopzZdEejW1JLE1Gx7IgYLRswOQ+/yFg8mE87DxSIVpL\r\n1IFpLYr5NmVlQCRmbQF0v5NTJ7odET/9vjBNPucrotjjYEzBBFZLYiSCx4so\r\ncqWQjYP6XH9QE4MlQWjPfTNiHMKX3wB5nBbdbxxH9jwB+KRhsDTdZFdeo+j+\r\nNXUJTuXU8GlTSH3bqnYTi0w4OoR/C2Z4ZuaKEaxPhHHyT8QTL1lkzYTXhR6r\r\nkXPSBOTjEI4cuO64Xn35Blnokk7dF+d7ja/KrDcuJ3mQa/EpRpsKOO15JIRy\r\nwyR3MMc1bUxL3FwpUX/GRoVEduN2CJSvbe0V2ag/43h49XlZ2r4ds2b6dA+K\r\nmACqdEH/4/GduoQelpv0btp/23LaRNJK9Aum8aoOQi6Kejix4I2wCMjbszai\r\n4jbjAT2Jmo1LqeAshC2gyo1soUKJgmHDwjjufPBwesi+pgodLp9SXpWVSPWl\r\ndDP7Q1tq9P/bh6n1lO8mYwacrRe7M8cjSVTdpkdM4vX+QlbK/9pW5IOpX4BG\r\nOnoErZHTBdiul0bzgXkte4O8cyL8gMGxa24=\r\n=2vwm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/plugin.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"a8c8edaa1c464d1cdf2c407915840a3cf01054e0","scripts":{"lint":"npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api CIDPrintPlugin --output-readme README.md --output-json dist/docs.json","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-cidprint.git","type":"git"},"_npmVersion":"7.22.0","description":"CaptureID Printer Plugin","directories":{},"_nodeVersion":"14.17.6","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.12.0","rimraf":"^3.0.0","rollup":"^2.21.0","prettier":"^2.0.5","swiftlint":"^1.0.1","typescript":"~3.8.3","@capacitor/ios":"^4.0.1","@capacitor/core":"^4.0.1","@capacitor/docgen":"^0.2.0","@capacitor/android":"^4.0.1","@ionic/eslint-config":"^0.3.0","prettier-plugin-java":"^0.8.0","@ionic/prettier-config":"^2.0.0","@ionic/swiftlint-config":"^1.1.2","@rollup/plugin-node-resolve":"^8.1.0"},"peerDependencies":{"@capacitor/core":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/capacitor4-cidprint_0.0.64_1661023107819_0.4076677628312484","host":"s3://npm-registry-packages"}},"0.0.65":{"name":"@captureid/capacitor4-cidprint","version":"0.0.65","keywords":["capacitor","plugin","native"],"author":{"name":"Uwe Hoppe"},"license":"MIT","_id":"@captureid/capacitor4-cidprint@0.0.65","maintainers":[{"name":"u-hoppe","email":"u.hoppe@p4it.com"}],"homepage":"https://github.com/P4IT/capacitor-plugin-cidprint#readme","bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidprint.git/issues"},"dist":{"shasum":"1a8bf330518d2731c258bfa56ce379ac5e56ad72","tarball":"https://registry.npmjs.org/@captureid/capacitor4-cidprint/-/capacitor4-cidprint-0.0.65.tgz","fileCount":106,"integrity":"sha512-fBe3EAbrhcFgOwkks5nbmCFalk6wmXVyqEAPW1Ds5SV+QL0RvhRZ147CyCS7GF1QmDy20ecZ87LAnXF4TbeqqQ==","signatures":[{"sig":"MEUCIHd8z8KgB0XZovT+aPiJ8di8OyQVFViZJBBKl4xUU5H6AiEAwkBC5UTzelIsEbYHYsYBghmgnZ0jSwxGmt6kuUtrOYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8102547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHuBnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAcBAAm6xMBd3VtTFx+y1gTw76l54ukelt3UUO3XNLFudxfp1NNUBr\r\njefxNGhFHuRz7WoLWJkW4dQzwyJWPHYb+U9TYQuuUdNayUPYDYHqTfKduq58\r\nwj0/KKEfSvgdYjmLtnDJFBTFJG8pUnmaQpA6nAC6Ty+0TLYy0Ie5RRLx3Via\r\n8UAvVnH/Jpa2S5kMW6x/40iK3b9lS9L0uVbO5uxsCpq1Rq1+6xa0RitLP+JW\r\nPzrXQGcj2s/3VEnRmuWZmGwuYATovkbpFI9g/NYiTPnb5zVzbSUZv42eLuOw\r\nN895Z1IcZvkWhy8Mklv2dFGqNYwyjMYsfh28Kjc1M0IoPRvjisFCfRaww/hd\r\nMIm3Nk69xM6ZvLHedaXkqgk91hVY9Q+q4nVay40k+nti42B3lhKUa+KcJ9gV\r\nDWcQFXItg73czReFFvnIGYZyocab0Zn9xAHjJUGZSBOCM/VrBoqCNtmD/G7I\r\np9GFVWLuYvnfIKwmMeDVXnRP1oz8887AKQsdKPlVSO64Rc8+Ginr5q/HV7NO\r\nBF7UhJVIgdhP8Vi1DcWKo6umbqXUaU1ZCnPGppv9i9prL/NX++blkWUNiBy2\r\ngxZ930Ov+hmee1LXJ4kGVlaVvdsNVUYkGmWevpZliB0XuX+FJ7lKCdW46Xlk\r\nLPgF31D/qx79RVSr3lAmwFwz1sxHcYCx4zA=\r\n=Drgt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/plugin.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"10bac5a88e31cd4f829627e0fffbf896f7880838","scripts":{"lint":"npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api CIDPrintPlugin --output-readme README.md --output-json dist/docs.json","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-cidprint.git","type":"git"},"_npmVersion":"7.22.0","description":"CaptureID Printer Plugin","directories":{},"_nodeVersion":"14.17.6","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.12.0","rimraf":"^3.0.0","rollup":"^2.21.0","prettier":"^2.0.5","swiftlint":"^1.0.1","typescript":"~3.8.3","@capacitor/ios":"^4.0.1","@capacitor/core":"^4.0.1","@capacitor/docgen":"^0.2.0","@capacitor/android":"^4.0.1","@ionic/eslint-config":"^0.3.0","prettier-plugin-java":"^0.8.0","@ionic/prettier-config":"^2.0.0","@ionic/swiftlint-config":"^1.1.2","@rollup/plugin-node-resolve":"^8.1.0"},"peerDependencies":{"@capacitor/core":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/capacitor4-cidprint_0.0.65_1662967911183_0.9187099857542196","host":"s3://npm-registry-packages"}},"0.0.66":{"name":"@captureid/capacitor4-cidprint","version":"0.0.66","keywords":["capacitor","plugin","native"],"author":{"name":"Uwe Hoppe"},"license":"MIT","_id":"@captureid/capacitor4-cidprint@0.0.66","maintainers":[{"name":"u-hoppe","email":"u.hoppe@p4it.com"}],"homepage":"https://github.com/P4IT/capacitor-plugin-cidprint#readme","bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidprint.git/issues"},"dist":{"shasum":"f739deed9bd5b1d47fec4575908ae09efc250546","tarball":"https://registry.npmjs.org/@captureid/capacitor4-cidprint/-/capacitor4-cidprint-0.0.66.tgz","fileCount":106,"integrity":"sha512-fy7uOtDkZb4q8tqoXBNb9JNXHRvhOLrqqq+vTRxVC5p7XpagbwDniX/5mBefk9SIkZPtYA9HCKxzUSqbQetr0w==","signatures":[{"sig":"MEYCIQDl4JzMBp1I/mGrYordo2vPH/wWHCOZ89YGuTjL7Kk3HwIhAKyem7I4TJLpL+98qBblS1FJ0+SSL2rZBb7v4UYrD+su","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8102732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjHuHTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowLxAAiyIuZiIU6FIE3YqxOeljUUFcNHly22DrDmLH4/EPfkumCs0v\r\n8TMvYZsKtq+4a9lUToLyolCHthx8VWcgsgBQcfK6BiUQt6cMS2a91YSdLVJy\r\nHf4hyq00htS48waCpC1NF2bQ3ngFw24Odj9NO7FeRYpviKAsWrGfeyMXOrzV\r\nUD+C7TeYJAIIR4iHDKn7hAPiy9IwTeYXV6D+BShA0DJcyPez3Qcgi4kVOfJ9\r\n1row8urIthZVAuxTtDy1gLsXsn07ezKUrIxvPeBrBcEkIghmDYWEhir7wT5B\r\nEEJDoMBZ8jp1CFsqZKIfAEoeq45MQGG2X/qHgrvslYNq+is8yugBN9ouV3CE\r\nYEFXz5bxSjwsL6NzM6puXGf/NlsXODS8oegb5IXazUV44ke+vUOYsz3ZKifi\r\nUgkX6gDGe3nHBPJIGCAVPbU6TsRJOsuJqkzLrCAYI0M5rpay6kAgs5dn6eDg\r\nVv2e8cWOsWvbJGkrLzM80F/qbJDwktNM7ARPNsamtM7QZsakPtEXyZ/xYop2\r\nfM/2tIHNYXFGshJGoVKTe/3QefKHDu5CZMJXt0BwfnU1vemG92sGSSXiKspF\r\nAhD7EYzOjvrgdVxCxq2lKA+bmA+8ek3LgtBTjqD1fJrMXcXZWrv5NoLlyf93\r\n47J7k65oCYDhJc4ddOPVtA9TAjwqv+U4v5Y=\r\n=dKPq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/plugin.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"eed7ba42eb5934a3ab1054ebb10fe5f7f917d01e","scripts":{"lint":"npm run prettier -- --check && npm run swiftlint -- lint","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.js","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api CIDPrintPlugin --output-readme README.md --output-json dist/docs.json","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-cidprint.git","type":"git"},"_npmVersion":"7.22.0","description":"CaptureID Printer Plugin","directories":{},"_nodeVersion":"14.17.6","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.12.0","rimraf":"^3.0.0","rollup":"^2.21.0","prettier":"^2.0.5","swiftlint":"^1.0.1","typescript":"~3.8.3","@capacitor/ios":"^4.0.1","@capacitor/core":"^4.0.1","@capacitor/docgen":"^0.2.0","@capacitor/android":"^4.0.1","@ionic/eslint-config":"^0.3.0","prettier-plugin-java":"^0.8.0","@ionic/prettier-config":"^2.0.0","@ionic/swiftlint-config":"^1.1.2","@rollup/plugin-node-resolve":"^8.1.0"},"peerDependencies":{"@capacitor/core":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/capacitor4-cidprint_0.0.66_1662968274824_0.7014971102768375","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-08-20T19:18:27.752Z","modified":"2026-09-02T06:49:48.856Z","0.0.64":"2022-08-20T19:18:28.171Z","0.0.65":"2022-09-12T07:31:51.432Z","0.0.66":"2022-09-12T07:37:55.214Z"},"bugs":{"url":"https://github.com/P4IT/capacitor-plugin-cidprint.git/issues"},"author":{"name":"Uwe Hoppe"},"license":"MIT","homepage":"https://github.com/P4IT/capacitor-plugin-cidprint#readme","keywords":["capacitor","plugin","native"],"repository":{"url":"git+https://github.com/P4IT/capacitor-plugin-cidprint.git","type":"git"},"description":"CaptureID Printer Plugin","maintainers":[{"email":"u.hoppe@p4it.com","name":"u-hoppe"},{"email":"s.hoppe@p4it.de","name":"shoppe"}],"readme":"[![appcenterbanner](https://www.captureid.de/wp-content/uploads/2021/05/captureid_logo_white.svg)](https://www.captureid.de/)\r\n\r\n# Ionic Capacitor 3 Plugin for Mobile Print\r\n\r\nThis plugin enables you to use the CaptureID Printer Library and to easily integrate Bluetooth printing 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 Printer plugin expires after a 3 month 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 Printer Plugin can be used in Ionic Capacitor app's to support label printing on SATO mobile Printers (i.e. MB200i, PW208nx), SATO Desktop Printers (i.e. CT4LX), Honeywell Printers that supports Fingerprint Language and a wide range of ZEBRA Printers (mobile and Desktop Models).\r\nIt enables you to easily scan for Bluetooth Printers, connect to an selected printer or the last connected printer.\r\n\r\n## Getting Started\r\n\r\nInstall the plugin into your existing project by running the command\r\n\r\n```shell\r\nnpm install @captureid/capacitor3-cidprint@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\nNote:\r\nIn case of an error during the build process stating cidprintlibrary and/or supportv1 can't be found you have to add the following entry into your apps build.gradle file to ensure the required files can be found.\r\n\r\nrepositories {\r\n    mavenLocal()\r\n    maven {\r\n        url(\"$rootDir/../node_modules/@captureid/capacitor3-cidprint/android\")\r\n    }\r\n}\r\n\r\n## Plugin Usage\r\n\r\nWith the CaptureID Printer plugin installed and configured, the only thing left is to add the necessary code to your app.\r\n\r\n1. Call the provided functions and add the callbacks.\r\n\r\n2. Call initCIDPrinterLib to initialize the Library. This method returns a PrinterLibraryEvent as result.\r\nIf the initialization of the PrinterLibrary is successful and the required Permissions are granted the fields of the PrinterLibraryEvent structure are set with the values\r\nIn case of the app is missing some permissions the EventType of the struct is set to NOTIFY and the data field is a type of InitResult class, which contains the required permissions in an array of strings.\r\n\r\n3. Register the LibraryListener with addListener(CIDPrinterListenerTypes.PRINTER_LIBRARY, (event: PrinterLibraryEvent) => {}). The Listener Method receives all event fired by the PrinterLibrary.\r\n   \r\n4. The method \"discoverDevices\" calls the Discover Listener, You can register the listener by adding the Listener Callback method with the Plugins.CIDPrint.addListener(ListenerTypes.DISCOVER, (result: any) => {\r\n    let data: PrinterEvent = result.result[0];}); command\r\n5. the result contains Result Type of PrinterEvent. The PrinterEvent structure\r\n    consist of the following fields:\r\n    \r\n    - __type__: PrinterEventType;\r\n    - __status__: PrinterStatusType;\r\n    - __message__: string;\r\n    - __error__: number;\r\n    - __device__: Device;\r\n    - __devices__: Device[];\r\n    - __action__: PrinterActionType;\r\n\r\n## API Reference\r\n\r\n- __initCIDPrinterLib()__: Promise<{event: PrinterLibraryEvent}>;\r\n- __closeCIDPrinterLib()__: void;\r\n- __activateLicense(options: { productKey: string; })__: void;\r\n- __enableBluetoothPrinting(options: { enable: boolean; })__: void;\r\n- __getPairedDevices()__: Promise<{}>;\r\n- __discoverDevices()__: void;\r\n- __connectToPreferredPrinter(options: { mac: string; })__: void;\r\n- __printData(options: { data: string; })__: void;\r\n- __printLabelWithData(options: { label: string; data: string[]; })__: void;\r\n- __printLabel(options: { label: string; })__: void;\r\n\r\n#\r\n\r\n### initCIDPrinterLib(): Promise<{event: PrinterLibraryEvent}>\r\n\r\n```javascript\r\nawait initCIDPrinterLib();\r\n```\r\nVersion 0.1.0\r\nParameters: - __none__\r\n\r\n[code sample](#initCIDPrint)\r\n#\r\n### closeCIDPrinterLib()\r\n\r\n```javascript\r\nawait closeCIDPrinterLib();\r\n```\r\nVersion 0.1.0\r\nParameters: - __none__\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- __key__ *(string)* - valid Licensekey.\r\n- __customer__ *(string)* - valid CustomerId.\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- __enable__ *(boolean)* - Enables/disables the Printing via  Bluetooth.\r\n\r\n#\r\n\r\n### getPairedDevices\r\n\r\n```javascript\r\ngetPairedDevices();\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:- __none__\r\n\r\n#\r\n\r\n### discoverDevices\r\n\r\n```javascript\r\ndiscoverDevices();\r\n```\r\nVersion 0.1.0\r\n\r\nParameters:- __none__\r\n\r\n#\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- __data__ *(string)* - data to be printed.\r\n\r\n#\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- __label__: path and filename of the label template file relative to the android project assets folder.\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#\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- __label__: path and filename of the label template file relative to the android project assets folder.\r\n\r\n#\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- __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#\r\n\r\n## Examples\r\n\r\n### initCIDPrint\r\n\r\n```javascript\r\nlet event: PrinterLibraryEvent = await CIDPrint.initCIDPrinterLib();\r\nif(event.type === EventType.NOTIFY) {\r\n  if(event.action === PrinterLibraryActionType.INITIALIZE) {\r\n    let data: InitResult = event.data as InitResult;\r\n    for(let i = 0; i < data.permissions.length; i++) {\r\n      // list the required permissions.\r\n    }\r\n  }\r\n}\r\n```\r\n\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\ncomplete source code\r\n\r\n## Examples\r\n\r\n\r\n```javascript\r\nimport { IonButton, IonContent, IonHeader, IonItem, IonList, IonPage, IonText, IonTitle, IonToolbar } from '@ionic/react';\r\nimport { Plugins } from '@capacitor/core';\r\nimport React, { Component } from 'react';\r\nimport ExploreContainer from '../components/ExploreContainer';\r\nimport './Home.css';\r\nimport 'capacitor-cidprint';\r\nimport { Device, ListenerTypes, PrinterActionType, PrinterEvent } from 'capacitor-cidprint';\r\nimport { useLocation } from 'react-router';\r\nimport { convertCompilerOptionsFromJson } from 'typescript';\r\n\r\nconst { CIDPrint } = Plugins;\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","readmeFilename":"README.md"}