Git Product home page Git Product logo

easy-im's Introduction

非官方即时通信SDK easy-im

非官方即时通信SDK,支持腾讯IM,环信IM,极光IM,融云IM,网易云信IM等

安装

composer require pkg6/easy-im

请求日志开启

\Pkg6\easyIm\Kernel\BaseClient::$request_log=true;

自定义缓存

基于https://packagist.org/packages/psr/simple-cache#1.0

$config = [
    'appId'      => '5978322198',
    'identifier' => 'administrator',
    'secretKey'  => 'nfugb53xtlhyfq2kgiriganruyoagh93it1zwysmh2tmj5tnnmuqhd2og5ofktjt',
    'cache'      => [
        //必须定义
        "class"         => \Pkg6\Cache\cache\driver\File::class,
        //其他选项
        'expire'        => 0,
        'cache_subdir'  => true,
        'prefix'        => '',
        'path'          => './cache/',
        'hash_type'     => 'md5',
        'data_compress' => false,
        'tag_prefix'    => 'tag:',
        'serialize'     => [],
    ],
];
$im     = Pkg6\easyIm\Factory::Tencent($config);

案例

$config = [
  'appId'      => '5978322198',
  'identifier' => 'administrator',
  'secretKey'  => 'nfugb53xtlhyfq2kgiriganruyoagh93it1zwysmh2tmj5tnnmuqhd2og5ofktjt',
];
$im = Pkg6\easyIm\Factory::Tencent($config);
// 自定义请求(账号同步到云端)
$params = [
    'Identifier' => 'easyim',
    'Nick'       => 'easyim',
    'FaceUrl'    => 'https://github.com/Pkg6/easy-im',
];
$im->request->send('im_open_login_svc/account_import', $params);
$config = [
  'appKey'       => '',
  'clientId'     => '',
  'clientSecret' => '',
  'orgName'      => '',
  'appName'      => '',
];
$im = Pkg6\easyIm\Factory::Huanxin($config);

// 自定义请求(账号同步到云端)
$params = [
    'username' => 'easyim',
    'password' => '123456',
    'nickname' => 'easyim'
];
$im->request->send('post', 'users', $params);
$config = [
  'appKey'       => '',
  'masterSecret' => '',
];
$im = Pkg6\easyIm\Factory::Jiguang($config);

// 自定义请求(账号同步到云端)
$params = [[
    'username' => 'easyim',
    'password' => '123456',
]];
$im->request->send('post', 'v1/users/', $params);

//IM REST Report V2
//获取消息
$im->request->send('get', 'v2/messages?count=500&begin_time=2015-11-02 10:10:10&end_time=2015-11-02 10:10:12',[],true);
$config = [
  'appKey'    => '',
  'appSecret' => '',
];
$im = Pkg6\easyIm\Factory::RongCloud($config);

// 自定义请求(账号同步到云端)
$params=[
    'userId' => 'easyim',
    'name'   => 'easyim',
];
$im->request->send('user/getToken.json', $params);
$config = [
  'appKey'    => '',
  'appSecret' => '',
];
$im = Pkg6\easyIm\Factory::Yunxin($config);
// 自定义请求(账号同步到云端)
$params = [
    'accid' => 'easyim',
    'name'  => 'easyim',
];
$im->request->send('nimserver/user/create.action', $params);

支持厂商

加入我们

如果你认可我们的开源项目,有兴趣为 easy-im 的发展做贡献,竭诚欢迎加入我们一起开发完善。无论是 报告错误或 是 Pull Request 开发,那怕是修改一个错别字也是对我们莫大的帮助。

许可协议

MIT

easy-im's People

Contributors

izhiqiang avatar

Forkers

qi5000 m1509001

easy-im's Issues

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.