public class MessageClient extends BaseClient
_baseUrl, _gson, _httpClient| 构造器和说明 |
|---|
MessageClient(java.lang.String appkey,
java.lang.String masterSecret) |
MessageClient(java.lang.String appkey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy,
JMessageConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
MessageListResult |
getMessageList(int count,
java.lang.String begin_time,
java.lang.String end_time)
Get message list from history, messages will store 60 days.
|
MessageListResult |
getMessageListByCursor(java.lang.String cursor)
Get message list with cursor, the cursor will effective in 120 seconds.
|
MessageListResult |
getUserMessages(java.lang.String username,
int count,
java.lang.String begin_time,
java.lang.String end_time)
Get message list from user's record, messages will store 60 days.
|
MessageListResult |
getUserMessagesByCursor(java.lang.String username,
java.lang.String cursor)
Get user's message list with cursor, the cursor will effective in 120 seconds.
|
cn.jiguang.common.resp.ResponseWrapper |
retractMessage(java.lang.String username,
long messageId)
retract message
消息撤回
|
SendMessageResult |
sendMessage(MessagePayload payload) |
public MessageClient(java.lang.String appkey,
java.lang.String masterSecret)
public MessageClient(java.lang.String appkey,
java.lang.String masterSecret,
cn.jiguang.common.connection.HttpProxy proxy,
JMessageConfig config)
public SendMessageResult sendMessage(MessagePayload payload) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cn.jiguang.common.resp.APIConnectionExceptioncn.jiguang.common.resp.APIRequestExceptionpublic MessageListResult getMessageList(int count, java.lang.String begin_time, java.lang.String end_time) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
count - Necessary parameter. The count of the message list.begin_time - Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'end_time - Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'cn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic MessageListResult getMessageListByCursor(java.lang.String cursor) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
cursor - First request will return cursorcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic MessageListResult getUserMessages(java.lang.String username, int count, java.lang.String begin_time, java.lang.String end_time) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - Necessary parameter.count - Necessary parameter. The count of the message list.begin_time - Optional parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'end_time - Optional parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'cn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic MessageListResult getUserMessagesByCursor(java.lang.String username, java.lang.String cursor) throws cn.jiguang.common.resp.APIConnectionException, cn.jiguang.common.resp.APIRequestException
username - Necessary parameter.cursor - First request will return cursorcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionpublic cn.jiguang.common.resp.ResponseWrapper retractMessage(java.lang.String username,
long messageId)
throws cn.jiguang.common.resp.APIConnectionException,
cn.jiguang.common.resp.APIRequestException
username - 用户名messageId - message idcn.jiguang.common.resp.APIConnectionException - connect exceptioncn.jiguang.common.resp.APIRequestException - request exceptionCopyright © 2017. All Rights Reserved.