TapTalk.io Documentation
  • Introduction
  • OneTalk Omnichannel Documentation
    • Getting Started with OneTalk
      • Team Members
      • Add Topic
      • Assign Agent to Topic
      • Paid Proactive Chat
    • Channel Integration
      • Telegram Integration
      • WhatsApp SME Integration
      • Instagram DM Integration
      • Facebook Messenger Integration
      • Live Chat Integration (iOS, Android, Web)
        • OneTalk Live Chat for Android
          • Get Started
          • Event Listener
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for iOS
          • Get Started
          • Background Process in TapTalk.io Omnichannel iOS
          • Event Delegate
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for Web
          • Get Started
          • Callback
          • Method
        • OneTalk Live Chat for React Native
          • Get Started - Android
          • Authentication - Android
          • Get Started - iOS
          • Authentication - iOS
        • OneTalk Live Chat for Flutter
          • Get Started - Android
          • Get Started - iOS
      • Google Business Messages Integration
      • Google Business Profile Integration
      • Tokopedia Integration
    • Integration API
      • Inbox API
      • User/Contact API
    • Live Chat Widget Callback Function
    • Social Channel Button
    • Custom Chatbot Integration
      • Get Started
      • Edit or Delete Chatbot
      • Development
    • QnA via API
    • Webhook
  • PowerTalk Chat SDK Documentation
    • Getting Started with PowerTalk
    • PowerTalk Android
      • Get Started
      • Enable Chat Features
      • Authentication
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Connection
      • Event Listener
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk iOS
      • Get Started
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Implement Application Delegate
      • Authentication
      • Connection
      • Event Delegate
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk React Native
      • Get Started - Android
      • Get Started - iOS
    • PowerTalk Flutter
      • Get Started - Android
      • Get Started - iOS
    • Javascript SDK
      • Get Started
      • Authentication
      • Connection
      • General
      • Event Listener
      • User
      • Room List
      • Chat Room
      • Messages
      • Contact
      • Message Type
    • Server API
      • Get Started
      • Base URL
      • Authentication
      • User
      • Contact
      • Message
      • Room
    • Webhook
      • Get Started
      • Webhook Payload
  • MeetTalk SDK Documentation
    • Getting Started with MeetTalk
    • MeetTalk Android
      • Get Started
      • Event Listener
    • MeetTalk iOS
      • Get Started
      • Implement Application Delegate
      • Event Delegate
  • SendTalk API Documentation
    • Introduction
    • Whatsapp Verification
Powered by GitBook
On this page
  • Connect to TapTalk.io server
  • Disconnect from TapTalk.io server
  • Check Connection Status
  • Enable / Disable Auto Connect
  • Get Auto Connect Status

Was this helpful?

  1. PowerTalk Chat SDK Documentation
  2. PowerTalk Android

Connection

Connect to TapTalk.io server

You can manually connect to TapTalk.io by calling connect() method.

Note: Please make sure that you have finished authentication by calling authenticate()method, otherwise, it will return an error

import io.taptalk.TapTalk.Helper.TapTalk;
import io.taptalk.TapTalk.Listener.TapCommonListener;

...

TapTalk.connect(new TapCommonListener() {
    @Override
    public void onSuccess(String successMessage) {
        // Successfully connected to TapTalk.io server
    }

    @Override
    public void onError(String errorCode, String errorMessage) {

    }
});
import io.taptalk.TapTalk.Helper.TapTalk
import io.taptalk.TapTalk.Listener.TapCommonListener

...

TapTalk.connect(object : TapCommonListener() {
    override fun onSuccess(successMessage: String?) {
        // Successfully connected to TapTalk.io server
    }

    override fun onError(errorCode: String?, errorMessage: String?) {

    }
})

Disconnect from TapTalk.io server

You can disconnect from TapTalk.io when the user no longer needs to receive messages from an online state. But the user can still receive push notifications for new messages when the app is closed.

When the user is disconnected from the server, all event delegates will stop receiving event callbacks from the server.

import io.taptalk.TapTalk.Helper.TapTalk;

...

TapTalk.disconnect();
import io.taptalk.TapTalk.Helper.TapTalk

...

TapTalk.disconnect()

Check Connection Status

You can check whether you are connected to TapTalk.io server by calling isConnected() method.

import io.taptalk.TapTalk.Helper.TapTalk;

...

boolean isConnected = TapTalk.isConnected();
import io.taptalk.TapTalk.Helper.TapTalk

...

var isConnected = TapTalk.isConnected()

Enable / Disable Auto Connect

You can choose to enable or disable auto connect by calling these methods. TapTalk.io will automatically connect to the server every time the user opens the app from the background when auto connect is enabled. Please note that the default value is enabled.

import io.taptalk.TapTalk.Helper.TapTalk;

...

@Override
public void onCreate() {
    ...
    
    // Call this method to enable or disable auto connect
    // The default value is set to enabled if you do not set this method
    TapTalk.setAutoConnectEnabled(IS_ENABLED);
}
import io.taptalk.TapTalk.Helper.TapTalk

...

override fun onCreate(savedInstanceState: Bundle?) {
    ...
    
    // Call this method to enable or disable auto connect
    // The default value is set to enabled if you do not set this method
    TapTalk.setAutoConnectEnabled(IS_ENABLED)
}

Parameters

IS_ENABLED: (BOOL) set to true to enable auto connect to TapTalk server

Get Auto Connect Status

Use this method to obtain auto connect status. This method will return true if auto connect is enabled

import io.taptalk.TapTalk.Helper.TapTalk;

...

boolean isAutoConnectEnabled = TapTalk.isAutoConnectEnabled();
import io.taptalk.TapTalk.Helper.TapTalk

...

var isAutoConnectEnabled = TapTalk.isAutoConnectEnabled()
PreviousBackground Process in TapTalk.ioNextEvent Listener

Last updated 28 days ago

Was this helpful?