项目作者: salamander-mh

项目描述 :
网易云信sdk
高级语言: PHP
项目地址: git://github.com/salamander-mh/YunXinHelper.git
创建时间: 2018-12-12T09:25:09Z
项目社区:https://github.com/salamander-mh/YunXinHelper

开源协议:

下载


安装

推荐使用composer:composer require salamander/yun-xin-helper

使用

创建实例

  1. $appKey = '****'; // 网易云信分配的账号
  2. $appSecrt = '****'; // 网易云信分配的密钥
  3. $entrance = new \YunXinHelper\Entrance($appKey, $appSecrt);

用户

  1. # 创建用户
  2. $entrance->user()->create($accid, $name, $icon);
  3. # 用户基本信息更新
  4. $entrance->user()->update($accid, $token);
  5. # 封禁用户
  6. $entrance->user()->block($accid);
  7. # 解禁用户
  8. $entrance->user()->unblock($accid);
  9. # 更新用户名片
  10. $entrance->user()->updateUserInfo($accid, $name, $icon);
  11. # 批量获取用户名片
  12. $entrance->user()->getUserInfos($accids);

消息功能

  1. # 文本消息
  2. $entrance->chat()->sendTextMsg($accidFrom, $to, $open, $text);
  3. # 图片消息
  4. $entrance->chat()->sendPictureMsg($accidFrom, $to, $open,
  5. $picName, $picMD5, $picUrl, $picExt, $picWidth, $picHeight, $picSize);
  6. # 批量文本消息
  7. $entrance->chat()->sendTextBatchMsg($accidFrom, $accidsTo, $text);
  8. # 发送自定义系统通知
  9. $entrance->chat()->sendAttachMsg($from, CHAT::CHAT_ONT_TO_ONE, $to, $attach);