1、收到新的好友申請
type:add_friend
返回參數說明
```
$message = [
'type'=>'add_friend', 【類型】
'is_secret' => $secret, 【是否是密聊申請 0不是 1 是】
'create_time' => date('m-d H:i'), 【申請時間】
'nickname'=> $user['nickname'], 【申請人昵稱】
'avatar' => $user['avatar'], 【申請人頭像】
'introduction' => $self_introduction, 【申請人簡介】
'msg' => '您有新的好友申請', 【提醒消息】
'add_id' => $result['add_id'], 【申請好友記錄ID】
'friend_id' => $user['id'] 【申請好友的D】
];
```
2、對方同意添加自己為好友
type:consent
返回參數說明
```
$message = [
'type' => 'consent', 【類型】
'is_secret' => $info['type'], 【是否是密聊申請 0不是 1 是】
'nickname' => $user['nickname'],【對方用戶昵稱】
'msg' => '同意了您的好友申請' 【提示消息】
];
```
3、對方拒絕添加自己為好友
type:refuse
返回參數說明
```
$message = [
'type' => 'refuse',【類型】
'is_secret' => $info['type'],【是否是密聊申請 0不是 1 是】
'nickname' => $user['nickname'],【對方用戶昵稱】
'msg' =>'拒絕了您的好友申請'【提示消息】
];
```
4、有新的會話消息
type:new_chat
返回參數說明
```
$message = [
'type' => 'new_chat', 【類型】
'sender_id' => $userId, 【 發送人ID】
'message_id'=> $result, 【最新消息ID】
'message_type' => $params['type'], 【消息類型】
'duration' => 0,【語音消息時長】
'message' => $params['message'], 【消息內容】
'sender_avatar' => $user['avatar'], 【發送人頭像】
'nickname' => $user['nickname'], 【發送人昵稱】
'is_secret' => $data['is_secret'], 【是否是密聊】
'create_time' =>'剛剛' 【發送時間】
];
```
5、有新的聊天消息
type:new_message
返回參數說明
~~~
$message = [
'type' => 'new_message', 【類型】
'message_id'=> $result, 【消息ID】
'message_type' => $params['type'],【消息類型】
'message' => $params['message'],【消息內容】
'duration' => 0,【語音消息時長】
'sender_id' => $userId,【發送人ID】
'sender_avatar' => $user['avatar'],【發送人頭像】
'show_time' => $showTime,【是否顯示時間 0 不顯示 1顯示】
'sender_nickname' => $user['nickname'],【發送人昵稱】
'create_time' => date('H:i'),【發送時間】
'is_secret' => $data['is_secret'],【是否是密聊 0 不是 1是】
];
~~~
6、消息類型介紹
```
1=文本,
2=語音,
3=圖片,
4=表情,
5=禮物
```