public class LCIMClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LCIMClient.LCIMClientStatus
当前client的状态
|
| Modifier and Type | Method and Description |
|---|---|
void |
close(LCIMClientCallback callback)
close client.
|
void |
createChatRoom(List<String> conversationMembers,
String name,
Map<String,Object> attributes,
boolean isUnique,
LCIMConversationCreatedCallback callback)
Create a new Chatroom
|
void |
createChatRoom(String name,
Map<String,Object> attributes,
LCIMConversationCreatedCallback callback)
Create a new Chatroom
|
void |
createConversation(List<String> conversationMembers,
Map<String,Object> attributes,
LCIMConversationCreatedCallback callback)
Create a new Conversation
|
void |
createConversation(List<String> members,
String name,
Map<String,Object> attributes,
boolean isTransient,
boolean isUnique,
LCIMConversationCreatedCallback callback)
Create a new Conversation
|
void |
createConversation(List<String> members,
String name,
Map<String,Object> attributes,
boolean isTransient,
LCIMConversationCreatedCallback callback)
Create a new Conversation
|
void |
createConversation(List<String> conversationMembers,
String name,
Map<String,Object> attributes,
LCIMConversationCreatedCallback callback)
Create a new Conversation
|
void |
createTemporaryConversation(List<String> conversationMembers,
int ttl,
LCIMConversationCreatedCallback callback)
Create a new temporary Conversation
|
void |
createTemporaryConversation(List<String> conversationMembers,
LCIMConversationCreatedCallback callback)
Create a new temporary Conversation
|
LCIMConversation |
getChatRoom(String conversationId)
get an existed Chatroom by id
|
LCIMConversationsQuery |
getChatRoomQuery()
获取开放聊天室的查询对象
开发者拿到这个对象之后,就可以像 IMConversationsQuery 以前的接口一样对目标属性(如名字)等进行查询。
|
static LCIMClientEventHandler |
getClientEventHandler() |
String |
getClientId()
获取当前用户的 clientId
|
static int |
getClientsCount()
count used clients.
|
void |
getClientStatus(LCIMClientStatusCallback callback) |
LCIMConversation |
getConversation(String conversationId)
get conversation by id
|
LCIMConversation |
getConversation(String conversationId,
boolean isTransient,
boolean isTemporary)
get an existed conversation
|
LCIMConversation |
getConversation(String conversationId,
int convType)
get conversation by id and type
|
LCIMConversationsQuery |
getConversationsQuery()
获取 IMConversationsQuery 对象,以此来查询 conversation
|
static String |
getDefaultClient()
get default clientId.
|
String |
getInstallationId() |
static LCIMClient |
getInstance(cn.leancloud.session.LCConnectionManager connectionManager,
String clientId,
LCInstallation installation)
get IMClient instance by clientId.
|
static LCIMClient |
getInstance(LCUser user)
get IMClient instance by LCUser
|
static LCIMClient |
getInstance(LCUser user,
String tag)
get IMClient instance by LCUser
|
static LCIMClient |
getInstance(String clientId)
get IMClient instance by clientId.
|
static LCIMClient |
getInstance(String clientId,
String tag)
get IMClient instance by clientId and tag.
|
void |
getOnlineClients(List<String> clients,
LCIMOnlineClientsCallback callback)
Query online clients.
|
LCIMConversation |
getServiceConversation(String conversationId)
get an existed Service Conversation
|
LCIMConversationsQuery |
getServiceConversationQuery()
获取服务号的查询对象
开发者拿到这个对象之后,就可以像 IMConversationsQuery 以前的接口一样对目标属性(如名字)等进行查询。
|
LCIMConversation |
getTemporaryConversation(String conversationId)
get an existed temporary conversation
|
protected void |
localClose() |
void |
open(LCIMClientCallback callback)
Open client.
|
void |
open(LCIMClientOpenOption option,
LCIMClientCallback callback)
Open Client with options.
|
static LCIMClient |
peekInstance(String clientId)
peek IMClient instance by clientId.
|
static void |
setClientEventHandler(LCIMClientEventHandler handler)
设置 IMClient 的事件处理单元,包括 Client 断开链接和重连成功事件
|
void |
updateRealtimeSessionToken(String token,
long expiredInSec)
[internal use only]
update realtime session token
|
public static void setClientEventHandler(LCIMClientEventHandler handler)
handler - event handler.public static LCIMClientEventHandler getClientEventHandler()
public String getInstallationId()
public static LCIMClient getInstance(String clientId)
clientId - client id.public static LCIMClient peekInstance(String clientId)
clientId - client id.public static LCIMClient getInstance(cn.leancloud.session.LCConnectionManager connectionManager, String clientId, LCInstallation installation)
connectionManager - connection manager.clientId - client id.installation - installation id.public static int getClientsCount()
public static String getDefaultClient()
public static LCIMClient getInstance(String clientId, String tag)
clientId - client id.tag - optional tag.public static LCIMClient getInstance(LCUser user)
user - user instance.public static LCIMClient getInstance(LCUser user, String tag)
user - user instance.tag - client tag.public void getClientStatus(LCIMClientStatusCallback callback)
public String getClientId()
public void open(LCIMClientCallback callback)
callback - callback function.public void open(LCIMClientOpenOption option, LCIMClientCallback callback)
option - open option.callback - callback function.public void getOnlineClients(List<String> clients, LCIMOnlineClientsCallback callback)
clients - client list.callback - callback function.public void createConversation(List<String> conversationMembers, Map<String,Object> attributes, LCIMConversationCreatedCallback callback)
conversationMembers - member list.attributes - attribute map.callback - callback function.public void createConversation(List<String> conversationMembers, String name, Map<String,Object> attributes, LCIMConversationCreatedCallback callback)
conversationMembers - member list.name - conversation name.attributes - attribute map.callback - callback function.public void createConversation(List<String> members, String name, Map<String,Object> attributes, boolean isTransient, LCIMConversationCreatedCallback callback)
members - member list.name - conversation name.attributes - attribute map.isTransient - flag of transient.callback - callback function.public void createConversation(List<String> members, String name, Map<String,Object> attributes, boolean isTransient, boolean isUnique, LCIMConversationCreatedCallback callback)
members - member list.name - conversation name.attributes - attribute map.isTransient - flag of transient.isUnique - flag of unique.callback - callback function.public void createTemporaryConversation(List<String> conversationMembers, LCIMConversationCreatedCallback callback)
conversationMembers - member list.callback - callback function.public void createTemporaryConversation(List<String> conversationMembers, int ttl, LCIMConversationCreatedCallback callback)
conversationMembers - member list.ttl - ttl value in seconds.callback - callback function.public void createChatRoom(List<String> conversationMembers, String name, Map<String,Object> attributes, boolean isUnique, LCIMConversationCreatedCallback callback)
conversationMembers - member list.name - conversation nameattributes - conversation attribute map.isUnique - deprecated chatroom is always not unique.callback - callback function.public void createChatRoom(String name, Map<String,Object> attributes, LCIMConversationCreatedCallback callback)
name - conversation nameattributes - conversation attribute map.callback - callback function.public LCIMConversation getConversation(String conversationId)
conversationId - conversation id.public LCIMConversation getConversation(String conversationId, int convType)
conversationId - conversation id.convType - conversation type.public LCIMConversation getConversation(String conversationId, boolean isTransient, boolean isTemporary)
conversationId - conversation id.isTransient - flag of transient.isTemporary - flag of temporary.public LCIMConversation getChatRoom(String conversationId)
conversationId - conversation id.public LCIMConversation getServiceConversation(String conversationId)
conversationId - conversation id.public LCIMConversation getTemporaryConversation(String conversationId)
conversationId - conversation id.public LCIMConversationsQuery getConversationsQuery()
public LCIMConversationsQuery getServiceConversationQuery()
public LCIMConversationsQuery getChatRoomQuery()
public void close(LCIMClientCallback callback)
callback - callback function.public void updateRealtimeSessionToken(String token, long expiredInSec)
token - session tokenexpiredInSec - expired interval.protected void localClose()
Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.