Giter Site home page Giter Site logo

rocketchat / rocket.chat.java.sdk Goto Github PK

View Code? Open in Web Editor NEW
29.0 16.0 23.0 2.89 MB

[DEPRECATED, NOT MAINTAINED] Java/Android SDK for Rocket.Chat

License: MIT License

Java 100.00%
java android livechat sdk chat-support rocketchat hacktoberfest rocketchat-sdk

rocket.chat.java.sdk's Introduction

DEPRECATED

We are working on a new SDK in Kotlin, with compatibility with JAVA (in the future).

Rocket.Chat.Java.SDK

License: MIT RocketChat Gitter chat

  • This SDK is used for handling background communication with server.
  • Contains set of remote procedure calls (RPC) to communicate with server and return appropriate results.
  • It doesn't have any user interface. All API's defined in SDK are asynchronous/non-blocking.

Overview

This SDK is divided into two parts

  1. Core SDK
  • Core SDK intro
  • RocketChat API usage documentation
  • RocketChat room API usage documentation

Download

  1. LiveChat SDK
  • LiveChat SDK intro
  • LiveChat API usage documentation
  • LiveChat room API usage documentation

Download

License

MIT

Gradle

For java

1. Core SDK

dependencies {
    compile 'com.rocketchat.core:rocketchat-core:0.7.1'
}

2. LiveChat SDK

dependencies {
    compile 'com.rocketchat.livechat:rocketchat-livechat:0.7.1'
}

For android

1. Core SDK

dependencies {
    compile ('com.rocketchat.core:rocketchat-core:0.7.1'){
        exclude group :'org.json', module: 'json'
    }
}

2. LiveChat SDK

dependencies {
    compile ('com.rocketchat.livechat:rocketchat-livechat:0.7.1'){
            exclude group :'org.json', module: 'json'
    }
}

Features

1. Core SDK

  • This SDK consist of chat related API's available on the Rocket.Chat server.
  • Currently supports following features.
  1. Login/Resume Login
  2. Getting Permissions/Getting public settings
  3. Getting User Roles
  4. Getting rooms
  5. Getting chat history
  6. Send message to the room
  7. Delete message
  8. Update message
  9. Pin message
  10. Unpin message
  11. Star message
  12. Create public group
  13. Create private group
  14. Delete group
  15. Archive room
  16. Unarchive room
  17. Join public group
  18. Leave group
  19. Open room
  20. Hide room
  21. Set favourite room
  22. Set status (ONLINE, OFFLINE, BUSY, AWAY)
  23. Getting room roles
  24. Upload files
  25. Getting status of other users in realtime (Register for user status by userId)
  26. Logout
  • User documentation can be found here => Core SDK

2. LiveChat SDK

  • This SDK refers to providing helpDesk feature (LiveChat )in any JVM platform.
  • This currently supports following features.
  1. Getting LiveChat configuration data from server
  2. Registration
  3. Login
  4. Choose departments
  5. Getting Chat history
  6. Getting Agent data
  7. Send message
  8. Subscribe room
  9. Close conversation

Important Note

All docs are available under docs/ directory on the repo.

Demo Android App

rocket.chat.java.sdk's People

Contributors

filipedelimabrito avatar luciofm avatar rafaelks avatar sacoo7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocket.chat.java.sdk's Issues

How can i Get Real time Room Msg???

How can i get Real time Message from From a particular Room? only room info? lol I think this is the only important and main part of this sdk.. i missed or u missed?

Rotating device will try to reconnect

I'm using latest version of the demo LiveChat SDK and when I do rotate the device, it seems to reconnect to the server. This is unexpected and unnecessary, it only needs to adjust the UI, nothing else.

News user Not possible Subscriptions or join room.

News user registerd via restapi Not possible Subscriptions or join room. not get getChatHistory. But it work Default main room but not work other Channel creted by admin.. If that user join using browser after only work in android

@OverRide
public void onLogin(TokenObject token, ErrorObject error) {
client.getSubscriptions(this);
}

@Override
public void onGetSubscriptions(List<SubscriptionObject> subscriptions, ErrorObject error) {
    ChatRoomFactory factory = client.getChatRoomFactory();   //client.is used for creating rooms from subscriptions/ rooms retured by either getSubscriptions or getRooms API
    room = factory.createChatRooms(subscriptions).getChatRoomByName("TestRoom");
}

onLoadHistory never called

chatRoom.getChatHistory(20, new Date(), null, this);

@OverRide
public void onLoadHistory(List list, int unreadNotLoaded, ErrorObject error) {
System.out.println("onLoadHistory size = " + list.size());
}

above is the callback which was never called by Rocket Chat although messages are printed in the log by System.out. Any ideas?

[QUESTION] Unable to connect server using realtime api

I am trying to connect server using realtime api of rocket chat
i have used these server url
server url = wss://server.com/websocket
or
server url = wss://server.com
But in both case i have got this error :
Disconnected from server
Jan 10, 2018 10:51:47 AM com.rocketchat.common.network.Socket onConnectError
WARNING: Connect error

Please help me how can i connect to rocket chat server using real time api . What server url i need or any configuration in server needed .

List Online users?

It is possible get list of online users? online users from specific room id or name?

Get webrtc invite

How can user get private webrtc invite? need some function about webrtc

JsonException when restoring object state

When saving the object state, as described in the specs: String state=room.toString(); saveToFile("filename.txt",state);

the follwing exception is throwned:
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1] at org.json.JSONTokener.syntaxError(JSONTokener.java:433) at org.json.JSONObject.<init>(JSONObject.java:194) at org.json.JSONObject.<init>(JSONObject.java:321) at io.rocketchat.livechat.LiveChatAPI$ChatRoom.<init>(LiveChatAPI.java:240) at hello.chat.ChatService.onInitialData(ChatService.java:132) at io.rocketchat.livechat.middleware.LiveChatMiddleware.processCallback(LiveChatMiddleware.java:48) at io.rocketchat.livechat.LiveChatAPI.onTextMessage(LiveChatAPI.java:176) at io.rocketchat.common.network.Socket$1.onTextMessage(Socket.java:112) at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:260) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:238) at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:963) at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:746) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

The room.toString() result looks lie this: ChatRoom{userName='guest-25', roomId='1jxze8nc7hs8h', userId='QciLCvpuMq2ZbimBb', visitorToken='-163d29c2d06bf5a4dc1915b4d9e34eeb', authToken='1LfwFzKYgsM3nphcV0EeY3jfnsp-9qBe6oPhRy01gtI'}, but it should look like this:
{userName='guest-25', roomId='1jxze8nc7hs8h', userId='QciLCvpuMq2ZbimBb', visitorToken='-163d29c2d06bf5a4dc1915b4d9e34eeb', authToken='1LfwFzKYgsM3nphcV0EeY3jfnsp-9qBe6oPhRy01gtI'}, in order to be successfully deserialized

File upload

I am trying to upload a fille using uploadFIle method it gives me upload error: ErrorObject{reason='Store not found', errorType='Meteor.Error', error=0, message='Store not found [invalid-store]'}

Doc, Source and Binary is not matching

Latest release is 0.7.1.9, doc and source is more like a mix version. You would find something different all the time 👍

Although you guys marked this as deprecated, the new library is still working in progress right? Please don't stop maintaining it.

Register Guest Token Issue

When calling register guest function, the following error is thrown:
org.json.JSONException: JSONObject["token"] not found. at org.json.JSONObject.get(JSONObject.java:473) 2018-07-15 01:51:26.124 at org.json.JSONObject.getString(JSONObject.java:654) at io.rocketchat.livechat.model.GuestObject.<init>(GuestObject.java:21) INFO at io.rocketchat.livechat.middleware.LiveChatMiddleware.processCallback(LiveChatMiddleware.java:57) at io.rocketchat.livechat.LiveChatAPI.onTextMessage(LiveChatAPI.java:176) at io.rocketchat.common.network.Socket$1.onTextMessage(Socket.java:112) at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:260) at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:238) at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:963) at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:746) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
P.S: I am using version 0.6.4, also on latest this issue reproduces

[NEW] Members list

Description

Add support to fetch the members list (paginated) in the SDK as a REST API.

Progress

  • API request;
  • Paginated support;
  • Unit tests;

[NEW] Pinned messages list

Description

Add support to fetch the pinned messages list (paginated) in the SDK as a REST API.

Progress

  • API request;
  • Paginated support;
  • Unit tests;

Separate into modules and artifacts

Separate the SDK into the modules and artifacts
livechat module - rocketchat-sdk-livechat artifact for LiveChat functionality
core module - rocketchat-sdk-core artifact for core SDK functionality, DDP protocol comunication.
common module - rocketchat-sdk-common artifact for common code used by both livechat and core modules.

409 Error on gradle dependency

Hello,
I am trying to add this SDK in version 0.2.0 into Android project in gradle dependencies but I get 409 Conflict error.

There is how I am adding sdk:
compile ('io.rocketchat:rocketchatjavasdk:0.2.0'){
exclude group :'org.json', module: 'json'
}

Here is an error:
{
"errors" : [ {
"status" : 409,
"message" : "The repository 'oss-snapshot-local' rejected the resolution of an artifact 'oss-snapshot-local:io/rocketchat/rocketchatjavasdk/0.2.0/rocketchatjavasdk-0.2.0.pom' due to conflict in the snapshot release handling policy."
} ]
}

Version 0.1.1 works fine, I have tested also on fresh project with clear gradle cache.

Opening an existent session will not subscribe to new messages

When I do open an existent LiveChat support conversation, it loads the history after I send the first message and keeps loading. It does not subscribe to new messages.

Expected results:

  1. Open existing conversation
  2. Instantly load the history
  3. Subscribe to new messages
  4. Allow user to send new messages to the conversation

[NEW] Files list

Description

Add support to fetch the files list (paginated) in the SDK as a REST API.

Progress

  • API request;
  • Paginated support;
  • Unit tests;

[NEW] Starred messages list

Description

Add support to fetch the starred messages list (paginated) in the SDK as a REST API.

Progress

  • API request;
  • Paginated support;
  • Unit tests;

how to build this sdk into a library file

I have added the compile line code in build.gradle to use this sdk. But still i doubt that all the sdk is imported. when i import any class its saying "cannot resolve symbol...".
Is there any way like we can build this sdk into a jar file or something and just copy it into the libs folder

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.