question

op27no2 avatar image
op27no2 asked op27no2 commented

Notification for order print?

Hello,

I was wondering if there was any way to be notified when any "order receipt" is printed.

Thanks

10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered op27no2 commented

You can use the print job API in the Clover Android SDK. If you print the job yourself using that API (PrintJobsConnector.print()), you will get back an ID that you can use to poll the status, or use a ContentObserver over the print jobs provider to watch asynchronously for changes in the print jobs database.

If you aren't printing the print job yourself, you can again use the print jobs API to get all the jobs in a given state (see PrintJobsConnector.getPrintJobIds()). For example, you could poll until all of the print jobs are in state DONE (see PrintJobsContract.STATE_*.

2 comments
10 |2000

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

op27no2 avatar image op27no2 commented ·

To follow up, how might I determine if it is an Order receipt in particular - any way to get the orderId??

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

That's not possible. We do not expose or document the contents of the print jobs database. It's not suitable for public consumption in it's current form.

0 Likes 0 ·

Welcome to the
Clover Developer Community