Skip to content

sacOO7/Rocket.Chat.Android.SDK

 
 

Repository files navigation

Rocket.Chat.Android.SDK

This SDK is divided into two parts

  1. Core SDK
  2. LiveChat SDK

This SDK currently provides support to include livechat client functionality in any android app.

License

MIT License

Gradle

Add below snippet in build.gradle file.

dependencies {
    compile 'com.github.rocketchat:rocketchatsdk:0.1.1'
}

Download

How to use

There are two major parts required to be followed

1. Set up Application class

  • Create Custom Application class that extends LiveChatApplication class in the library. Add name of this custom class in the manifest file. Inside onCreate method call setServerUrl(url) passing url of the server as a parameter.

Example :

  1. Creating custom Application class as "MyApplication"
    public class MyApplication extends LiveChatApplication {

    public static String serverurl="wss://livechattest.rocket.chat/websocket";

    @Override
    public void onCreate() {
        setServerUrl(serverurl);
        super.onCreate();
    }
}
     
  1. Declaring class name in manifest file
    <application
            android:name=".MyApplication" \\ can change depending on package location
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            .........
            ........

2. Open ChatActivity

  • Clicking on required view will start new activity by passing ChatActivity as a parameter to the startActivity intent.

Example:
support is a button (required view). Clicking on button will fire intent to open ChatActivity.

     support.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(getApplicationContext(),ChatActivity.class);
                startActivity(intent);
            }
        });

Note : This library currently do not support configuration having any departments at server side. Make sure no department is created or available at server side LiveChat configuartion.

For more information refer sample code under 'app' directory.

About

Rocket.Chat's Android Native SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%