Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cn.rongcloud.im:server-sdk-java

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cn.rongcloud.im:server-sdk-java

For improving the efficiency of developers,RongCloud provides an open source IM Server SDK officially. With this SDK, you can get token, send messages, add sensitive words, ban user, manage group, create chat room and so on.

  • 3.5.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

server-sdk-java

RongCloud IM Server SDK in Java.

集成

  • 中央仓库获取JAR
  • Maven
    <dependency>
        <groupId>cn.rongcloud.im</groupId>
        <artifactId>server-sdk-java</artifactId>
        <version>3.5.0</version>
    </dependency>
  • Gradle
    compile group: 'cn.rongcloud.im', name: 'server-sdk-java', version: '3.5.0'
   
  • 基于源码 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.5.0 版本,老版本的 Server SDK仍可使用,但不支持发送消息返回消息ID。

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc