Giter Club home page Giter Club logo

imsdk-web-sdk's Introduction

imsdk-web-sdk

IMSDK Web SDK,由爱萌科技官方维护

概述

IMSDK Web SDK V1 版本,使用传统的 ajax long polling 的方式,兼容更多版本浏览器。

通过 Web SDK 可以方便实现注册、登录、收发消息

新手上路

一、获取 SDK

官方下载:http://www.imsdk.im/

github:https://github.com/imsdk/imsdk-web-sdk

下载到的包里包含 Demo 和 Lib 两个目录,其中 Demo 目录为一个简单的演示页面。

该 Lib 依赖于jquery,开发时使用版本为 jquery-2.1.4.min.js,可从下载到的文件中得到。

移动端涉及到的表情包 IMSysface 可于 Lib 目录中找到,目前 Web 端未做处理

二、初始化

var imCli = new IMSDK( '00b6413a92d4c1c84ad99e0a', {
    onInitialized : function( appEnv ){
        console.info( '初始化环境完成,当前应用:' + appEnv.appKe
    },
    onTextReceived : function( TextMsg ){
        console.info('收到文本消息 - TextMsg');
         
    },
    onImageReceived : function( ImageMsg ){},
    onVoiceReceived : function( VoiceMsg ){},
    onSystemMsgReceived : function( SystemMsg ){}  
} );

三、发送消息

var userMsg = {
    'target_type' : type,
    'target' : target,
    'msg_type' : 'txt',
    'content' : msg
};
imCli.sendText( userMsg, function(data, params){
    console.log( 'send data success');
}, function(code, error, params){
});

更多信息

IMSDK官方文档

imsdk-web-sdk's People

Contributors

eddielin avatar imsdk avatar

Watchers

James Cloos avatar

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.