6.5 消息接口调用

所有消息接口均在 V5ClientAgent.h 中有说明,部分接口可参考下面的示例进行调用。

通用的发送消息接口:

//通过V5MessageManager构造消息对象
V5Message *textMessage = [V5MessageManager obtainTextMessageWithContent:@ "消息内容"];
//通过sendMessage方法发送消息对象
[[V5ClientAgent shareClient] sendMessage:textMessage];

此外,也可通过下面简便封装好的方式发送文本和图片消息:

/**
 * 发送文本消息
 *
 * @param content 文本消息
 */
- (V5TextMessage *)sendTextMessageWithContent:(NSString *)content;

/**
 * 发送本地图片
 *
 * @param image 图片
 */
- (V5ImageMessage *)sendImageMessageWithImage:(UIImage *)image;

发送消息结果在 V5MessageDelegate 中的方法 sendMessageResult: expcetion: 回调。

results matching ""

    No results matching ""

    results matching ""

      No results matching ""