Skip to content
プロジェクト

概要

RongCloud Server SDK in Java.

開発ツール

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

server-sdk-java

RongCloud IM Server SDK in Java.

Integration

  • Get the JAR from the Maven repository
  • Maven
    <dependency>
        <groupId>cn.rongcloud.im</groupId>
        <artifactId>server-sdk-java</artifactId>
        <version>4.0.16</version>
    </dependency>
  • Gradle
    compile group: 'cn.rongcloud.im', name: 'server-sdk-java', version: '4.0.16'
  • Build from source
   1. Download or clone `server-sdk-java`
   
   2. Navigate to the `server-sdk-java` directory
   
   3. Install dependencies with `mvn install`
   
   4. Package with `mvn clean package`
  • Runtime environment

    Java version 7+

Usage

Go to the Developer Console to create an app and get your App Key and Secret.

Here’s how to register a user:

  String appKey = "appKey";
  String appSecret = "appSecret";
      
  // Initialize the RongCloud SDK, Set up the data center you use.
  RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,CenterEnum.BJ);
  User user = rongCloud.user;

  /**
  *
  * Register a user and generate a unique Token in RongCloud
  */
  UserModel userModel = new UserModel()
            .setId("hHjap87")
            .setName("RongCloud")
            .setPortrait("http://www.rongcloud.cn/images/logo.png");
  TokenResult result = user.register(userModel);
  System.out.println("getToken: " + result.toString());
# Print result
# getToken: {"reqBody":"userId=userxxd2&name=username&portraitUri=http%3A%2F%2Fwww.rongcloud.cn%2Fimages%2Flogo.png","code":1002,"errorMessage":"Invalidate App-Key.","requestId":"0c1f127e9bc1401bb05eaad61b4502f7"}

Note: Each API call returns a unique request ID, which identifies the request to RongCloud.

Examples

User module example
Message module example
Group module example
Chatroom module example
Conversation module example
Sensitive word module example
Ultra group module example

Version notes

We’ve updated to SDK version 3.8.0 for easier integration and better maintenance. Data center must be specified for new version initialization

関連プロジェクトを探す

読み込み中…