Callback listeners
#
FlyCallbackFlyCallback is used as a base callback method for most io operations. It's written as a single medthod inteface so that developers can make use of lambda in java and kotlin.
- Java
- Kotlin
#
Observe Chat ConnectionTo observe the chat connection status you can either implement or create a annonymous ChatConnectionListener
interface and attach it to ChatConnectionManager.
- Java
- Kotlin
#
Observe Profile EventsTo observe profile related events you can either implement or create a annonymous ProfileEventsListener
interface and attach it to ChatEventsManager and detach the listener when no longer needed.
Example:
- Java
- Kotlin
#
Attach/Detach ProfileEventsListenerProperly attach and detach the listeners whenever necessary.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
PROFILE_EVENTS_LISTENER | ProfileEventsListener | ProfileEventsListener anonytmous inner class object or a class reference that implements ProfileEventsListener |
Note: Only one listener will be attached at any given time.
#
Contacts Profiles Fetched.If the client application has mobile number as the primary identifier of the user and enabled contact sync they can fetch their contacts data and its completion is triggered in the following callbacks.
- Java
- Kotlin
#
User blocked youIf a user blocked you then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
User unblocked youIf a user unblocked you then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
User Updated his profileIf a user updated his profile then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
User Deleted his profileIf a user deleted his profile then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
My Profile update statusOnce you initiated the update for your profile its status will be triggered by the following method in the profileEventsListener.
- Java
- Kotlin
#
User came onlineIf a user came online then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
User went offineIf a user went offline then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
Users blocked me list callbackWhen called to get the users who blocked me then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
Users i blocked list callbackWhen called to get the users who i blocked then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
User profile fetchedWhen called to get the profile detatil of a user from the server then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
Block a userWhen called to block a user then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
UnBlock a userWhen called to unblock a user then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
Logged outWhen logout called then the following method will be triggered in the profileEventsListener.
- Java
- Kotlin
#
Observe Group EventsTo observe group related events you can either implement or create a annonymous GroupEventsListener
class and attach it to ChatEventsManager and detach the listener when no longer needed.
Example:
- Java
- Kotlin
#
Attach/Detach GroupEventsListenerProperly attach and detach the listeners whenever necessary.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
GROUP_EVENTS_LISTENER | GroupEventsListener | GroupEventsListener anonytmous inner class object or a class reference that implements GroupEventsListener |
Note: Only one listener will be attached at any given time.
#
Group Profile FetchedWhen the request for fetching a group profile is completed successfully this callback will be triggered.
- Java
- Kotlin
#
Group notification message receivedWhen events like new member added or member removed a notification message will be generated locally and inserted in the local database. After insertion this callback will be triggered.
- Java
- Kotlin
#
New group createdWhen a new group was created like when someone added you to a group this callback will be triggered.
- Java
- Kotlin
#
Group profile updatedWhen a group profile is updated this callback will be triggered.
- Java
- Kotlin
#
New member added to groupWhen a new member is added to the group this callback will be triggered.
- Java
- Kotlin
#
Member removed from groupWhen a member is removed from the group this callback will be triggered.
- Java
- Kotlin
#
Fetching group membersWhen a group is created, members of that group will be fetched once sucessfully fetched this callback will be triggered.
- Java
- Kotlin
#
Group member became an adminWhen a group member became an admin this callback will be triggered.
- Java
- Kotlin
#
Admin access revokedWhen a group member's admin access is revoked this callback will be triggered.
- Java
- Kotlin
#
Member left from the groupWhen a member left the group this callback will be triggered.
- Java
- Kotlin
#
Group deleted locallyWhen the current user delete a group locally this callback will be triggered.
- Java
- Kotlin
#
Observing the message eventsYou need to register the observer to observe all the message related events, so that you can update the UI immediately based on the message events.Once you have sent the message via sdk, you will get the callbacks for message status events.you can register your own listener by using the below method. This is common for both single chat and groups.
tip
There can be only one message listener at a time, if you set multiple times using the below method it will replace the old listener always.
- Java
- Kotlin
info
For group, message status will be updated only if all the participants sent the delivery/seen status.
#
Observing the Archive Chats eventsWhen the Recent Chat Archive/UnArchive by user this callback will be triggered.
- Java
- Kotlin
When a user click on Archive Settings option this callback will be triggered.
- Java
- Kotlin