AbobosSoftware / cordova-plugin-brother-label-printer

Cordova and Capacitor plugin for Bother Label Printers
MIT License
10 stars 16 forks source link

Using this plugin with Capcitor #61

Open Groganj89 opened 5 months ago

Groganj89 commented 5 months ago

I am trying to use this plugin with capacitor.

I have followed instruction to run:

npm install cordova-plugin-brother-label-printer

I have then ran npx cap sync to which I get this:

⠙ update ios [info] Found 1 Cordova plugin for ios: cordova-plugin-brother-label-printer@1.8.0

From this point, how do I call the function such as findPrinters within the www/printers.js.

I am about to yeet myself out of a window...

arcadius commented 5 months ago

Hello @Groganj89 There is a sample code at https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer#sample-code

Groganj89 commented 5 months ago

https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer#sample-code

I tried this but I do not have access to Cordova as it is not defined in a Capacitor application.

arcadius commented 5 months ago

When you install the plugin, capacitor brings in cordova code .... so cordova becomes available. Before using the sample code, you only need to declare cordova like declare var cordova: any

I updated the sample code at https://github.com/AbobosSoftware/cordova-plugin-brother-label-printer#sample-code