非官方即时通信SDK easy-im
非官方即时通信SDK,支持腾讯IM,环信IM,极光IM,融云IM,网易云信IM等
composer require openphp/easy-im
\openphp\easyIm\Kernel\BaseClient::$request_log=true;
$config = [
'appId' => '5978322198',
'identifier' => 'administrator',
'secretKey' => 'nfugb53xtlhyfq2kgiriganruyoagh93it1zwysmh2tmj5tnnmuqhd2og5ofktjt',
];
$im = openphp\easyIm\Factory::Tencent($config);
// 自定义请求(账号同步到云端)
$params = [
'Identifier' => 'easyim',
'Nick' => 'easyim',
'FaceUrl' => 'https://github.com/openphp/easy-im',
];
$im->request->send('im_open_login_svc/account_import', $params);
$config = [
'appKey' => '',
'clientId' => '',
'clientSecret' => '',
'orgName' => '',
'appName' => '',
];
$im = openphp\easyIm\Factory::Huanxin($config);
// 自定义请求(账号同步到云端)
$params = [
'username' => 'easyim',
'password' => '123456',
'nickname' => 'easyim'
];
$im->request->send('post', 'users', $params);
$config = [
'appKey' => '',
'masterSecret' => '',
];
$im = openphp\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 = openphp\easyIm\Factory::RongCloud($config);
// 自定义请求(账号同步到云端)
$params=[
'userId' => 'easyim',
'name' => 'easyim',
];
$im->request->send('user/getToken.json', $params);
$config = [
'appKey' => '',
'appSecret' => '',
];
$im = openphp\easyIm\Factory::Yunxin($config);
// 自定义请求(账号同步到云端)
$params = [
'accid' => 'easyim',
'name' => 'easyim',
];
$im->request->send('nimserver/user/create.action', $params);
如果你认可我们的开源项目,有兴趣为 easy-im 的发展做贡献,竭诚欢迎加入我们一起开发完善。无论是 报告错误或 是 Pull Request 开发,那怕是修改一个错别字也是对我们莫大的帮助。