1. Install TIO Chat SDK

Setup gradle maven

Open build.grade file and add maven line like below

allprojects {
    repositories {
        google()  
        mavenCentral()
        maven {
            url "https://gitlab.com/api/v4/projects/47870260/packages/maven"
            credentials(HttpHeaderCredentials) {
                name = "Private-Token"
                value = "{SDK_PRIVATE_KEY}"
            }
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
    }
}

Open file app/build.grade then add sdk:

dependencies {
...
    implementation 'com.mobile:tiosdk:1.0.2'
}

Initialize TIO Chat in file Application

@Override
    public void onCreate() {
        super.onCreate();
        ...
        TioConfig config = new TioConfig.Builder()
                .setHttpsAddress("https://tio-chat.dev.ftech.ai")
                .setResourceAddress("https://minio.dev.ftech.ai")
                .setSecretKey("FY0xOa")
                .setCookieName("tio_session")
                .build();
        TioSdkManager.INSTANCE.init(this, config, reason -> {
            // handle when was kicked account
        });
    }

Last updated