User Presence

Enable/Disable hide seen status#

Hide Last seen status enables the user's last logged in time unavailable to their friends. To enable or disable the hide last seen status of the user call the below method.

FlyCore.enableDisableHideLastSeen( ENABLE_LAST_SEEN,(isSuccess, throwable, data) -> {
if (isSuccess) {
// Last seen status updated successfully
} else {
// updation failed print throwable for more info
}
});
ArgumentTypeDescription
ENABLE_LAST_SEENbooleantrue enables the last seen available to friends false disables it
CALLBACKFlyCallbackFlyCallback implemented as lambda expression

Check hide last seen status#

To check whether last seen status is available to friends or not, call the below method.

boolean lastSeenStatus = FlyCore.isHideLastSeenEnabled();

Get Last seen time of a user#

if you want to get the last seen time for the chat user, you can utilise the below method.

ContactManager.getRegisteredUserLastSeenTime(JID , LISTENER );
ArgumentTypeDescription
JIDStringjid of the chat user
LISTENERLastSeenListenerLastSeenListener callback to observe the action status

Note : This method return to the timestamp value 0 means ONLINE otherwise you need to convert to the timestamp value based on your timezone.