0

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?

asked 2017-03-20 09:15:08 -0500

Nirmal gravatar image
Comments

Can you Private Message me a pastebin of a minimal, complete, verifiable example, to help me reproduce this issue? Thank you.

rachel gravatar image
rachel 2017-03-21 16:25:37 -0500

Can you verify that your app was running on both instances (Station and Mini)? EmployeeConnector listener will only fire when the app is active (running in foreground or background).

Sam gravatar image
Sam 2017-03-22 11:58:55 -0500

1 answer

Sort by  
0

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

answered 2017-03-23 17:56:18 -0500

mark.mullan gravatar image