question

James Tickett avatar image
James Tickett asked Mark Mullan Deactivated answered

Detecting when Employee has changed

We have an app that is allowing certain functionality only to those with Admin role. We return the employee and check the role during onResume().

We found that if the app is in the background when a new employee enters their PIN, this is fine as it will trigger the event to check again. However, if the app is in the foreground when the employee changeover happens then it does not trigger onResume().

Do you know if there's a better way that we can be doing this?

Thanks, James

Employees
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

Mark Mullan avatar image
Mark Mullan Deactivated answered

Hi James,

Listening for the ACTION_ACTIVE_EMPLOYEE_CHANGED broadcast would be relevant here.

https://github.com/clover/clover-android-sdk/blob/5c6a9de3ac5c3783153b13625c559f1014b46841/clover-android-sdk/src/main/java/com/clover/sdk/v3/employees/EmployeeIntent.java#L35-L40

If this is your first time setting up a BroadcastReceiver for Clover, the hello world example here might be useful. Hope this helps-

Mark

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