Event Listener
MeetTalk Android SDK provides interface to listen to various events on the client app. The interface class MeetTalkListener replaces the usage of TapListener class from PowerTalk Android SDK and also contains all the callbacks that TapListener has.
All other listener classes from PowerTalk SDK can still be implemented normally.
MeetTalkListener
MeetTalkListener notifies general events from PowerTalk SDK and call/conference related events from MeetTalk SDK. A MeetTalkListener instance is required when initializing MeetTalk SDK.
Not all of the listener callbacks are required to be handled, but we strongly suggest to override onTapTalkRefreshTokenExpired
to handle authentication when the user's session has expired.
MeetTalkListener meetTalkListener = new MeetTalkListener() {
/**
* =============================================================================================
* TapListener callbacks
* =============================================================================================
*/
@Override
public void onInitializationCompleted(String instanceKey) {
// Initialization process has finished
}
@Override
public void onTapTalkRefreshTokenExpired() {
// Authentication is needed
}
@Override
public void onTapTalkUnreadChatRoomBadgeCountUpdated(int unreadCount) {
// Returns number of unread messages from the application
}
@Override
public void onNotificationReceived(TAPMessageModel message) {
// A new message from TapTalk.io is received
}
@Override
public void onUserLogout() {
// User has finished logging out from TapUI or TapTalk.logoutAndClearAllTapTalkData() process has completed
}
@Override
public void onTaskRootChatRoomClosed(Activity activity) {
// A chat room activity was closed by user when no other activity in the application is present
// You may start another activity to keep the app open, otherwise the app will stay closed
}
/**
* =============================================================================================
* MeetTalk call/conference notification callbacks
* =============================================================================================
*/
@Override
public void onReceiveCallInitiatedNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Call Initiated" notification message is received
// Will show incoming call by default
MeetTalk.showIncomingCall(message);
}
@Override
public void onReceiveCallCancelledNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Call Cancelled" notification message is received
}
@Override
public void onReceiveCallEndedNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Call Ended" notification message is received
}
@Override
public void onReceiveRecipientAnsweredCallNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Recipient Answered Call" notification message is received
}
@Override
public void onReceiveRecipientBusyNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Recipient is Busy" notification message is received
}
@Override
public void onReceiveRecipientRejectedCallNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Recipient Rejected Call" notification message is received
}
@Override
public void onReceiveRecipientMissedCallNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Recipient Missed Call" notification message is received
}
@Override
public void onReceiveRecipientUnableToReceiveCallNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Recipient is Unable to Receive Call" notification message is received
}
@Override
public void onReceiveActiveUserRejectedCallNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Current/Active User Rejected Call" notification message is received
}
@Override
public void onReceiveParticipantJoinedConferenceNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Participant Joined Conference" notification message is received
}
@Override
public void onReceiveParticipantLeftConferenceNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Participant Left Conference" notification message is received
}
@Override
public void onReceiveConferenceInfoUpdatedNotificationMessage(String instanceKey, TAPMessageModel message, MeetTalkConferenceInfo meetTalkConferenceInfo) {
// A "Conference Info" notification message is received
}
/**
* =============================================================================================
* MeetTalk incoming call callbacks
* =============================================================================================
*/
@Override
public void onIncomingCallReceived(String instanceKey, TAPMessageModel message) {
// A new incoming call is received
}
@Override
public void onShowIncomingCallFailed(String instanceKey, TAPMessageModel message, String errorMessage) {
// MeetTalk SDK failed to show incoming call
}
@Override
public void onIncomingCallAnswered() {
// Current/active user answers the incoming call
// Will join the incoming call by default
MeetTalk.joinPendingIncomingConferenceCall();
}
@Override
public void onIncomingCallRejected() {
// Current/active user rejects the incoming call
// Will close the incoming call by default
MeetTalk.rejectPendingIncomingConferenceCall();
}
@Override
public void onIncomingCallDisconnected() {
// Incoming call was closed
}
/**
* =============================================================================================
* MeetTalk conference callbacks
* =============================================================================================
*/
@Override
public void onDisconnectedFromConference(MeetTalkConferenceInfo meetTalkConferenceInfo) {
// Current/active user was disconnected from an ongoing conference call
}
@Override
public void onReconnectedToConference(MeetTalkConferenceInfo meetTalkConferenceInfo) {
// Current/active user successfully reconnected to ongoing conference call
}
@Override
public void onConferenceJoined(MeetTalkConferenceInfo meetTalkConferenceInfo) {
// Current/active user successfully joined conference call
}
@Override
public void onConferenceTerminated(MeetTalkConferenceInfo meetTalkConferenceInfo) {
// Ongoing conference call was terminated
}
/**
* =============================================================================================
* MeetTalk UI callbacks
* =============================================================================================
*/
@Override
public void onTaskRootCallActivityClosed(Activity activity) {
// A conference call activity was closed when no other activity in the application is present
// You may start another activity to keep the app open, otherwise the app will stay closed
}
@Override
public void onChatBubbleCallButtonTapped(String instanceKey, Activity activity, TAPMessageModel message) {
// Call button in TapUI's chat room message bubble was tapped by user
// Will initiate a new conference call by default
MeetTalk.initiateNewConferenceCall(activity, instanceKey, message.getRoom());
}
val meetTalkListener = object : MeetTalkListener() {
/**
* =============================================================================================
* TapListener callbacks
* =============================================================================================
*/
override fun onInitializationCompleted(instanceKey: String?) {
// Initialization process has finished
}
override fun onTapTalkRefreshTokenExpired() {
// Authentication is needed
}
override fun onTapTalkUnreadChatRoomBadgeCountUpdated(unreadCount: Int) {
// Returns number of unread messages from the application)
}
override fun onNotificationReceived(message: TAPMessageModel?) {
// A new message from TapTalk.io is received
}
override fun onUserLogout() {
// User has finished logging out from TapUI or TapTalk.logoutAndClearAllTapTalkData() process has completed
}
override fun onTaskRootChatRoomClosed(activity: Activity?) {
// A chat room activity was closed by user when no other activity in the application is present
// You may start another activity to keep the app open, otherwise the app will stay closed
}
/**
* =============================================================================================
* MeetTalk call/conference notification callbacks
* =============================================================================================
*/
override fun onReceiveCallInitiatedNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A Call Initiated notification message is received
// Will show incoming call by default
MeetTalk.showIncomingCall(message)
}
override fun onReceiveCallCancelledNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Call Cancelled" notification message is received
}
override fun onReceiveCallEndedNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Call Ended" notification message is received
}
override fun onReceiveRecipientAnsweredCallNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Recipient Answered Call" notification message is received
}
override fun onReceiveRecipientBusyNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Recipient is Busy" notification message is received
}
override fun onReceiveRecipientRejectedCallNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Recipient Rejected Call" notification message is received
}
override fun onReceiveRecipientMissedCallNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Recipient Missed Call" notification message is received
}
override fun onReceiveRecipientUnableToReceiveCallNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Recipient is Unable to Receive Call" notification message is received
}
override fun onReceiveActiveUserRejectedCallNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Current/Active User Rejected Call" notification message is received
}
override fun onReceiveParticipantJoinedConferenceNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Participant Joined Conference" notification message is received
}
override fun onReceiveParticipantLeftConferenceNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Participant Left Conference" notification message is received
}
override fun onReceiveConferenceInfoUpdatedNotificationMessage(
instanceKey: String?,
message: TAPMessageModel?,
meetTalkConferenceInfo: MeetTalkConferenceInfo?
) {
// A "Conference Info" notification message is received
}
/**
* =============================================================================================
* MeetTalk incoming call callbacks
* =============================================================================================
*/
override fun onIncomingCallReceived(
instanceKey: String?,
message: TAPMessageModel?
) {
// A new incoming call is received
}
override fun onShowIncomingCallFailed(
instanceKey: String?,
message: TAPMessageModel?,
errorMessage: String?
) {
// MeetTalk SDK failed to show incoming call
}
override fun onIncomingCallAnswered() {
// Current/active user answers the incoming call
// Will join the incoming call by default
MeetTalk.joinPendingIncomingConferenceCall()
}
override fun onIncomingCallRejected() {
// Current/active user rejects the incoming call
// Will close the incoming call by default
MeetTalk.rejectPendingIncomingConferenceCall()
}
override fun onIncomingCallDisconnected() {
// Incoming call was closed
}
/**
* =============================================================================================
* MeetTalk conference callbacks
* =============================================================================================
*/
override fun onDisconnectedFromConference(meetTalkConferenceInfo: MeetTalkConferenceInfo?) {
// Current/active user was disconnected from an ongoing conference call
}
override fun onReconnectedToConference(meetTalkConferenceInfo: MeetTalkConferenceInfo?) {
// Current/active user successfully reconnected to ongoing conference call
}
override fun onConferenceJoined(meetTalkConferenceInfo: MeetTalkConferenceInfo?) {
// Current/active user successfully joined conference call
}
override fun onConferenceTerminated(meetTalkConferenceInfo: MeetTalkConferenceInfo?) {
// Ongoing conference call was terminated
}
/**
* =============================================================================================
* MeetTalk UI callbacks
* =============================================================================================
*/
override fun onTaskRootCallActivityClosed(activity: Activity?) {
// A conference call activity was closed when no other activity in the application is present
// You may start another activity to keep the app open, otherwise the app will stay closed
}
override fun onChatBubbleCallButtonTapped(
instanceKey: String?,
activity: Activity?,
message: TAPMessageModel?
) {
// Call button in TapUI's chat room message bubble was tapped by user
// Will initiate a new conference call by default
MeetTalk.initiateNewConferenceCall(activity, instanceKey, message.getRoom());
}
}
Last updated