question

meerchant avatar image
meerchant asked ·

How can I be notified of a failed print attempt

When I connect to an ethernet Star Micro printer, I can use the Star Micro SDK which lets when there is a problem (lets say printer is out of paper or went offline). However, when I print to a USB Star Micro printer or the built in printer, I have to us the Clover SDK. So I am using ImagePrintJob and that works most of the time, but how can I get notified when there is a printing problem? The print() method doesn't throw any exceptions and there are no callbacks.

Thanks, Rom

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jacob Abrams avatar image
Jacob Abrams answered ·
Apparently this is now possible using PrintJobsConnector you can get a print job id which you can then poll for the status. See https://clover.github.io/clover-android-sdk/com/clover/sdk/v1/printer/job/PrintJobsConnector.html
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jacob Abrams avatar image
Jacob Abrams answered ·

Is there a reason you need to be notified? The device will notify the merchant of print failures issuing Android notifications and give them a chance to retry regardless of what app requested the print job. If you want your app may want to offer a reprint button. Even if the print job succeeded the merchant still might want to print another copy anyway.

3 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the quick answer, but yes we do need to be notified. Our app has a background service that checks for new online orders and prints the tickets and updates our server. We intentionally have this background service starting on device boot to periodically check for new orders and print them. But we don't want this service to update our server if the print fails.

0 Likes 0 · ·

@Jacob Abrams Any update to this question since 2015?

0 Likes 0 · ·

Looks like it is possible to get the status now via polling. See new answer.

0 Likes 0 · ·

Welcome to the
Clover Developer Community