question

ojhatushar avatar image
ojhatushar asked Jeffrey Blattman answered

Any Intent or Broadcast receiver when clicked button of sync manually on Inventory app or register app?

We have make an app using clover sdk in which we are applying discount . We are storing inventory data in our local database like price,name etc and afterwards we are using background service,which is updating the order and putting discount when some criteria gets fulfilled on register app.but when vendor or user who have clover device when change the price of particular item from inventory app and sync it from sync button, the price is reflected there in register or inventory app, but how to reflect that same price in our local database, because our app is in background.So when price gets changed it show discount based on older price and not on new price of item.So any Intent or Broadcast receiver or any event is there when manually clicking of sync button of Inventory app or register app?
OR Any other solution for this problem?
InventoryIntentsDiscountsBroadcasts
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
Inventory can be changed from other devices or directly from the cloud, so hooking in to the refresh button on the local device isn't what you want.

Why can't you just read the current price from Clover's inventory system, whatever it may be, before you use it? It's not clear to me why you want to keep a copy of it.

You can register content observers over the inventory DB, but Android isn't going to allow you to run continuously in the background. I think the best you can do is, when you are triggered, ensure you are synced at that time.
10 |2000

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