GithubHelp home page GithubHelp logo

samplelivechatsdk's Introduction

Live Chat SDK by Sociomile

Required

  • Programming language Kotlin
  • Minimum Android SDK 21 (Android 5.0 - 5.0.2 Lollipop)

Download

  1. Add jcenter, maven central and jitpack to the root build.gradle file of your project at the end of repositories.
allprojects {
  repositories {
    ...
    jcenter()
    mavenCentral()
    maven { url 'https://jitpack.io' }
  }
}
  1. Add into the root local.properties file of your project.
# credential for download library live chat sdk request to admin sociomile
ext.user = /* your userid */
ext.key = /* your personal token */
  1. Add into app/build.gradle file of your project.
plugins {
    ...
}

Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
repositories {
    maven {
        name = "GitHubPackages"
        url = uri("https://maven.pkg.github.com/AsepDanis/LiveChatSDK")
        credentials {
            username = properties.getProperty("ext.user")
            password = properties.getProperty("ext.key")
        }
    }
}

android {
    ...
}
  1. Add the dependency
implementation "org.sociomile.livechat.sdk:core:1.0.5"

Usage

Usage is very simply, you only need to do following:

Add this widget into your xml layout:

<org.sociomile.livechat.sdk.ChatFab
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="16dp"
    app:themeColor="red|blue"/>

Configuration

  • your set clientId already registered in sociomile:
SocketManager.clientId = "/* your clientId set in here */"
  • your create CoroutineEvent.registerEvent for handle event:
CoroutineEvent.registerEvent(String::class.java) { event ->
    when(event) {
        SocketManager.TAG_RESET -> {
            binding.fab.count = 0
        }
        SocketManager.TAG_UPDATE -> {
            binding.fab.increase()
        }
    }
}

samplelivechatsdk's People

Contributors

asepdanis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.