You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
Hi there,
Trying to use this in my Capacitor project, seems to build fine but does not talk to printer.
npm i cordova-plugin-sunmi-inner-printer
//(Have not imported the package, should???
// import * as sunmi from 'cordova-plugin-sunmi-inner-printer'???
//have following after my angular imports:
declare var sunmiInnerPrinter: any;
//below in a function on a button
```
try {
console.log('trying to print');
if (JSON.stringify(sunmiInnerPrinter) !== "{}") {
//theres a problem
console.log('Printer output',JSON.stringify(sunmiInnerPrinter));
return;
}
// it is safe to use sunmiInnerPrinter here
sunmiInnerPrinter.printerInit();
console.log('status',JSON.stringify(sunmiInnerPrinter.getPrinterVersion()));
sunmiInnerPrinter.printOriginalText("Hello Printer");
} catch(err) {
console.log("error: "+ JSON.stringify(err));
}
> ng build
> npx cap sync
----
Copying capacitor.config.json in 1.34ms
⠼ copy Found 1 Cordova plugin for android
cordova-plugin-sunmi-inner-printer (1.1.0)
✔ copy in 389.04ms
✔ Updating Android plugins in 49.87ms
Found 1 Capacitor plugin for android:
@capacitor-community/fcm (1.0.8)
Found 1 Cordova plugin for android
cordova-plugin-sunmi-inner-printer (1.1.0)
✔ update android in 394.63ms
----
Run the Android project on my Sumni device I get the following message:
D/SunmiInnerPrinter: Service connected
But when I print nothing happens and I get the following logs:
I/Capacitor/Console: File: http://localhost/vendor.js - Line 86038 - Msg: trying to print
I/Capacitor/Console: File: http://localhost/vendor.js - Line 86038 - Msg: error: {}
Thank you in advance for your help. I've got a few of these devices now so keen to get it working if I can
Rich
Capacitor version 6.14.11
Angular 7.3.1
Ionic 5.4.16
The text was updated successfully, but these errors were encountered:
@RichyFennell i have the same issue
I have a P2Pro where it works perfectly.
But on my V2s i noticed that InnerPrinterManager.getInstance().bindService(applicationContext, innerPrinterCallback);
returns false
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there,
Trying to use this in my Capacitor project, seems to build fine but does not talk to printer.
//(Have not imported the package, should???
// import * as sunmi from 'cordova-plugin-sunmi-inner-printer'???
//have following after my angular imports:
declare var sunmiInnerPrinter: any;
//below in a function on a button
The text was updated successfully, but these errors were encountered: