https://github.com/pigloverabbit520/yunxinhelper
网易云信sdk
https://github.com/pigloverabbit520/yunxinhelper
php sdk sdk-php
Last synced: 19 days ago
JSON representation
网易云信sdk
- Host: GitHub
- URL: https://github.com/pigloverabbit520/yunxinhelper
- Owner: pigLoveRabbit520
- Created: 2018-12-12T09:25:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T05:33:41.000Z (over 6 years ago)
- Last Synced: 2025-06-14T17:02:20.410Z (5 months ago)
- Topics: php, sdk, sdk-php
- Language: PHP
- Size: 217 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 安装
推荐使用composer:`composer require salamander/yun-xin-helper`
# 使用
### 创建实例
```
$appKey = '****'; // 网易云信分配的账号
$appSecrt = '****'; // 网易云信分配的密钥
$entrance = new \YunXinHelper\Entrance($appKey, $appSecrt);
```
### 用户
```
# 创建用户
$entrance->user()->create($accid, $name, $icon);
# 用户基本信息更新
$entrance->user()->update($accid, $token);
# 封禁用户
$entrance->user()->block($accid);
# 解禁用户
$entrance->user()->unblock($accid);
# 更新用户名片
$entrance->user()->updateUserInfo($accid, $name, $icon);
# 批量获取用户名片
$entrance->user()->getUserInfos($accids);
```
### 消息功能
```
# 文本消息
$entrance->chat()->sendTextMsg($accidFrom, $to, $open, $text);
# 图片消息
$entrance->chat()->sendPictureMsg($accidFrom, $to, $open,
$picName, $picMD5, $picUrl, $picExt, $picWidth, $picHeight, $picSize);
# 批量文本消息
$entrance->chat()->sendTextBatchMsg($accidFrom, $accidsTo, $text);
# 发送自定义系统通知
$entrance->chat()->sendAttachMsg($from, CHAT::CHAT_ONT_TO_ONE, $to, $attach);
```