I am currently finding logout of employee onActiveEmployeeChanged(Employee employee) method of EmployeeConnector. It is working fine on clover station but onEmployeeChanged is not firing when logged out in clover mini. How can we found this?
I am currently finding logout of employee onActiveEmployeeChanged(Employee employee) method of EmployeeConnector. It is working fine on clover station but onEmployeeChanged is not firing when logged out in clover mini. How can we found this?
Hi @Nirmal,
The ACTIVE_EMPLOYEE_CHANGED broadcast is fired both when an employee logs in and logs out. Register the receiver in the manifest:
<receiver
android:name=".MyBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.clover.sdk.employee.intent.action.ACTIVE_EMPLOYEE_CHANGED" />
</intent-filter>
</receiver>
And then receive it:
public class MyBroadcastReceiver extends BroadcastReceiver {
private static final String TAG = "MyBroadcastReceiver";
@Override
public void onReceive(Context context, Intent intent) {
String employeeId = intent.getStringExtra(Intents.EXTRA_EMPLOYEE_ID);
Log.d(TAG, "onReceive: " + employeeId);
}
}
Logout events make employeeId == null
Cheers,
Mark
No one has followed this question yet.