question

Mateus avatar image
Mateus asked ·

Can the Clover Register App auto update the screen when a line item is added(via REST API) to the order being displayed?

What I want to do is: I add an item to an order in the Clover Register App. As I have a broadcast receiver listening for "com.clover.intent.action.LINEITEMADDED", I check some properties of this item and if it matches my criteria, I will add a new line item(via the REST API) to represent an extra tax. My expectation is that once the API call returns with success, the list of items displayed on the screen would auto update to show the new item added via API.

I tried the above on an emulator and what happens is that although the tax line item is added successfully, the Clover Register app doesn't auto update the screen with the new item. In order to see the new item, I have to click on Order, on the left menu, then click on the Order I was adding items to, and finally click on Re-open.

Is there any way I can force the list of items displayed to auto update when an item is added to that order via API?

Orders
2 comments
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.

Have you tried adding the line item using the orderConnector?

0 Likes 0 · ·

Thanks @rachel, that worked!

0 Likes 0 · ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered ·

Per @rachel, if you want that to work reliably use the Clover Android SDK's OrderConnector to add the line item. If you cal l the REST API from the device, you can normally expect a push message at some point instructing the device to pull down the updated order. The problem however is that there's no guarantee when or even if you'll get that push message.

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.

Welcome to the
Clover Developer Community