2 Star 7 Fork 4

融云 RongCloud / server-sdk-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

server-sdk-java

RongCloud IM Server SDK in Java.

集成

  • 中央仓库获取JAR
  • Maven
    <dependency>
        <groupId>cn.rongcloud.im</groupId>
        <artifactId>server-sdk-java</artifactId>
        <version>3.3.9</version>
    </dependency>
  • Gradle
    compile group: 'cn.rongcloud.im', name: 'server-sdk-java', version: '3.3.9'
   
  • 基于源码 Meavn 打包构建
   1、下载或克隆 `server-sdk-java`
   
   2、进入项目 `server-sdk-java` 目录
   
   3、安装依赖 `mvn install`
   
   4、打包 `mvn clean package`
   
  • 运行环境
Java版本  7+

使用

请前往 开发者后台 创建应用 -> 获取 Appkey、Secret

以注册用户为例

  String appKey = "appKey";
  String appSecret = "appSecret";
       
  RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret);
  User user = rongCloud.user;

  /**
  *
  * 注册用户,生成用户在融云的唯一身份标识 Token
  */
  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());
# 打印结果
# getToken:  {"reqBody":"userId=userxxd2&name=username&portraitUri=http%3A%2F%2Fwww.rongcloud.cn%2Fimages%2Flogo.png","code":1002,"errorMessage":"Invalidate App-Key.","requestId":"0c1f127e9bc1401bb05eaad61b4502f7"}

特别说明: 接口每次调用都会返回唯一的 requestId ,此 Id 为请求融云的唯一标识。

示例

用户模块示例
消息模块示例
群组模块示例
聊天室模块示例
会话模块示例
敏感词模块示例
超级群模块示例

版本说明

为方便开发者的接入使用,更好的对融云 Server SDK 进行维护管理,现更新SDK 3.0 版本,老版本的 Server SDK仍可使用 但不兼容。

The MIT License (MIT) Copyright (c) 2014 Rong Cloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Rong Cloud Server SDK in Java. 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/rongcloud/server-sdk-java.git
git@gitee.com:rongcloud/server-sdk-java.git
rongcloud
server-sdk-java
server-sdk-java
master

搜索帮助