whereof/easy-im

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

1.0.0 2021-11-28 08:28 UTC

This package is auto-updated.

Last update: 2022-01-04 03:10:19 UTC


README

非官方即时通信SDK easy-im

开源地址: Gitee | Github

开发者文档: wiki

687474703a2f2f706f7365722e707567782e6f72672f77686572656f662f656173792d696d2f76 687474703a2f2f706f7365722e707567782e6f72672f77686572656f662f656173792d696d2f646f776e6c6f616473 687474703a2f2f706f7365722e707567782e6f72672f77686572656f662f656173792d696d2f762f756e737461626c65 687474703a2f2f706f7365722e707567782e6f72672f77686572656f662f656173792d696d2f6c6963656e7365 687474703a2f2f706f7365722e707567782e6f72672f77686572656f662f656173792d696d2f726571756972652f706870

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

安装

composer require whereof/easy-im

请求日志开启

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

案例

腾讯IM

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

环信IM

$config = [
  'appKey'       => '',
  'clientId'     => '',
  'clientSecret' => '',
  'orgName'      => '',
  'appName'      => '',
];
$im = whereof\easyIm\Factory::Huanxin($config);

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

极光IM

$config = [
  'appKey'       => '',
  'masterSecret' => '',
];
$im = whereof\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);

融云IM

$config = [
  'appKey'    => '',
  'appSecret' => '',
];
$im = whereof\easyIm\Factory::RongCloud($config);

// 自定义请求(账号同步到云端)
$params=[
    'userId' => 'easyim',
    'name'   => 'easyim',
];
$im->request->send('user/getToken.json', $params);

网易云信IM

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

支持厂商

加入我们

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

关于我

https://github.com/whereof/whereof

许可协议

MIT