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());
    }

Last updated

#621:

Change request updated