LeanCloud C# SDK
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
LeanCloud.Realtime.LCIMClient Class Reference

LCIMClient is a local representation of realtime client in LeanCloud. More...

Public Member Functions

 LCIMClient (string clientId, string tag=null, string deviceId=null, ILCIMSignatureFactory signatureFactory=null)
 Constructs a LCIMClient with client id.
 
 LCIMClient (LCUser user, string tag=null, string deviceId=null, ILCIMSignatureFactory signatureFactory=null)
 Constructs a LCIMClient with a LCUser.
 
async Task Open (bool force=true)
 Signing in.
 
async Task Close ()
 Closes the session.
 
async Task< LCIMConversationCreateConversation (IEnumerable< string > members, string name=null, bool unique=true, Dictionary< string, object > properties=null)
 Creates a conversation.
 
async Task< LCIMChatRoomCreateChatRoom (string name, Dictionary< string, object > properties=null)
 Creates a chatroom.
 
async Task< LCIMTemporaryConversationCreateTemporaryConversation (IEnumerable< string > members, int ttl=86400, Dictionary< string, object > properties=null)
 Creates a temporary conversation.
 
async Task< LCIMConversationGetConversation (string id)
 Queries a conversation based on its id.
 
async Task< ReadOnlyCollection< LCIMConversation > > GetConversationList (IEnumerable< string > ids)
 Queries conversations based on their ids.
 
LCIMConversationQuery GetQuery ()
 Constructs a conversation query.
 

Public Attributes

Action< LCIMConversation, string > OnMuted
 Occurs when the current user is muted in a conversation.
 
Action< LCIMConversation, string > OnUnmuted
 Occurs when the current user is unmuted in a conversation.
 
Action< LCIMConversation, ReadOnlyDictionary< string, object >, string > OnConversationInfoUpdated
 Occurs when the properties of a conversation are updated.
 
Action< LCIMConversation, string, string, string > OnMemberInfoUpdated
 Occurs when the properties of someone are updated.
 

Properties

string Id [get]
 Client Id.
 
string Tag [get]
 Client tag.
 
string DeviceId [get]
 Device Id.
 
Action OnPaused [get, set]
 Occurs when the connection is lost.
 
Action OnResume [get, set]
 Occurs when the connection is recovered.
 
Action< int, string > OnClose [get, set]
 Occurs when the connection is closed and there will be no auto reconnection. Possible causes include there is a single device login conflict or the client has been kicked off by the server.
 
Action< LCIMConversation, string > OnBlocked [get, set]
 Occurs when the current user is added into the blacklist of a conversation.
 
Action< LCIMConversation, string > OnUnblocked [get, set]
 Occurs when the current user is removed from the blacklist of a conversation.
 
Action< LCIMConversation, string > OnInvited [get, set]
 Occurs when the current user is invited to a conversation.
 
Action< LCIMConversation, string > OnKicked [get, set]
 Occurs when the current user is kicked from a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersJoined [get, set]
 Occurs when a user joined a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersLeft [get, set]
 Occurs when a user left a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersBlocked [get, set]
 Occurs when a user is added to the blacklist of a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersUnblocked [get, set]
 Occurs when a user is removed from the blacklist of a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersMuted [get, set]
 Occurs when a user is muted in a conversation.
 
Action< LCIMConversation, ReadOnlyCollection< string >, string > OnMembersUnmuted [get, set]
 Occurs when a user is unmuted in a conversation.
 
Action< LCIMConversation, LCIMMessageOnMessage [get, set]
 Occurs when a new message is delivered to a conversation the current user is already in.
 
Action< LCIMConversation, LCIMRecalledMessageOnMessageRecalled [get, set]
 Occurs when a message is recalled.
 
Action< LCIMConversation, LCIMMessageOnMessageUpdated [get, set]
 Occurs when a message is updated.
 
Action< LCIMConversation, string > OnMessageDelivered [get, set]
 Occurs when a message is delivered.
 
Action< LCIMConversation, string > OnMessageRead [get, set]
 Occurs when a message is read.
 
Action< ReadOnlyCollection< LCIMConversation > > OnUnreadMessagesCountUpdated [get, set]
 Occurs when the number of unreadMessagesCount is updatded.
 
Action< LCIMConversationOnLastDeliveredAtUpdated [get, set]
 Occurs when the last delivered message is updated.
 
Action< LCIMConversationOnLastReadAtUpdated [get, set]
 Occurs when the last read message is updated.
 

Detailed Description

LCIMClient is a local representation of realtime client in LeanCloud.

Constructor & Destructor Documentation

◆ LCIMClient() [1/2]

LeanCloud.Realtime.LCIMClient.LCIMClient ( string  clientId,
string  tag = null,
string  deviceId = null,
ILCIMSignatureFactory  signatureFactory = null 
)
inline

Constructs a LCIMClient with client id.

Parameters
clientId
tag
deviceId
signatureFactory

◆ LCIMClient() [2/2]

LeanCloud.Realtime.LCIMClient.LCIMClient ( LCUser  user,
string  tag = null,
string  deviceId = null,
ILCIMSignatureFactory  signatureFactory = null 
)
inline

Constructs a LCIMClient with a LCUser.

Parameters
user
tag
deviceId
signatureFactory

Member Function Documentation

◆ Close()

async Task LeanCloud.Realtime.LCIMClient.Close ( )
inline

Closes the session.

Returns

◆ CreateChatRoom()

async Task< LCIMChatRoom > LeanCloud.Realtime.LCIMClient.CreateChatRoom ( string  name,
Dictionary< string, object >  properties = null 
)
inline

Creates a chatroom.

Parameters
nameThe name of this chatroom
propertiesCustom attributes of this chatroom
Returns

◆ CreateConversation()

async Task< LCIMConversation > LeanCloud.Realtime.LCIMClient.CreateConversation ( IEnumerable< string >  members,
string  name = null,
bool  unique = true,
Dictionary< string, object >  properties = null 
)
inline

Creates a conversation.

Parameters
membersThe list of clientIds of participants in this conversation (except the creator)
nameThe name of this conversation
uniqueWhether this conversation is unique; if it is true and an existing conversation contains the same composition of members, the existing conversation will be reused, otherwise a new conversation will be created.
propertiesCustom attributes of this conversation
Returns

◆ CreateTemporaryConversation()

async Task< LCIMTemporaryConversation > LeanCloud.Realtime.LCIMClient.CreateTemporaryConversation ( IEnumerable< string >  members,
int  ttl = 86400,
Dictionary< string, object >  properties = null 
)
inline

Creates a temporary conversation.

Parameters
membersThe list of clientIds of participants in this temporary conversation (except the creator)
ttlTTL of this temporary conversation
propertiesCustom attributes of this temporary conversation
Returns

◆ GetConversation()

async Task< LCIMConversation > LeanCloud.Realtime.LCIMClient.GetConversation ( string  id)
inline

Queries a conversation based on its id.

Parameters
idobjectId
Returns

◆ GetConversationList()

async Task< ReadOnlyCollection< LCIMConversation > > LeanCloud.Realtime.LCIMClient.GetConversationList ( IEnumerable< string >  ids)
inline

Queries conversations based on their ids.

Parameters
idsobjectId list
Returns

◆ GetQuery()

LCIMConversationQuery LeanCloud.Realtime.LCIMClient.GetQuery ( )
inline

Constructs a conversation query.

Returns

◆ Open()

async Task LeanCloud.Realtime.LCIMClient.Open ( bool  force = true)
inline

Signing in.

Parameters
forceIf this is ture (default value), and single device sign-on is enabled, users already logged in on another device with the same tag will be logged out.
Returns

Member Data Documentation

◆ OnConversationInfoUpdated

Action<LCIMConversation, ReadOnlyDictionary<string, object>, string> LeanCloud.Realtime.LCIMClient.OnConversationInfoUpdated

Occurs when the properties of a conversation are updated.

◆ OnMemberInfoUpdated

Action<LCIMConversation, string, string, string> LeanCloud.Realtime.LCIMClient.OnMemberInfoUpdated

Occurs when the properties of someone are updated.

◆ OnMuted

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnMuted

Occurs when the current user is muted in a conversation.

◆ OnUnmuted

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnUnmuted

Occurs when the current user is unmuted in a conversation.

Property Documentation

◆ DeviceId

string LeanCloud.Realtime.LCIMClient.DeviceId
get

Device Id.

◆ Id

string LeanCloud.Realtime.LCIMClient.Id
get

Client Id.

◆ OnBlocked

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnBlocked
getset

Occurs when the current user is added into the blacklist of a conversation.

◆ OnClose

Action<int, string> LeanCloud.Realtime.LCIMClient.OnClose
getset

Occurs when the connection is closed and there will be no auto reconnection. Possible causes include there is a single device login conflict or the client has been kicked off by the server.

◆ OnInvited

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnInvited
getset

Occurs when the current user is invited to a conversation.

◆ OnKicked

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnKicked
getset

Occurs when the current user is kicked from a conversation.

◆ OnLastDeliveredAtUpdated

Action<LCIMConversation> LeanCloud.Realtime.LCIMClient.OnLastDeliveredAtUpdated
getset

Occurs when the last delivered message is updated.

◆ OnLastReadAtUpdated

Action<LCIMConversation> LeanCloud.Realtime.LCIMClient.OnLastReadAtUpdated
getset

Occurs when the last read message is updated.

◆ OnMembersBlocked

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersBlocked
getset

Occurs when a user is added to the blacklist of a conversation.

◆ OnMembersJoined

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersJoined
getset

Occurs when a user joined a conversation.

◆ OnMembersLeft

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersLeft
getset

Occurs when a user left a conversation.

◆ OnMembersMuted

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersMuted
getset

Occurs when a user is muted in a conversation.

◆ OnMembersUnblocked

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersUnblocked
getset

Occurs when a user is removed from the blacklist of a conversation.

◆ OnMembersUnmuted

Action<LCIMConversation, ReadOnlyCollection<string>, string> LeanCloud.Realtime.LCIMClient.OnMembersUnmuted
getset

Occurs when a user is unmuted in a conversation.

◆ OnMessage

Action<LCIMConversation, LCIMMessage> LeanCloud.Realtime.LCIMClient.OnMessage
getset

Occurs when a new message is delivered to a conversation the current user is already in.

◆ OnMessageDelivered

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnMessageDelivered
getset

Occurs when a message is delivered.

◆ OnMessageRead

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnMessageRead
getset

Occurs when a message is read.

◆ OnMessageRecalled

Action<LCIMConversation, LCIMRecalledMessage> LeanCloud.Realtime.LCIMClient.OnMessageRecalled
getset

Occurs when a message is recalled.

◆ OnMessageUpdated

Action<LCIMConversation, LCIMMessage> LeanCloud.Realtime.LCIMClient.OnMessageUpdated
getset

Occurs when a message is updated.

◆ OnPaused

Action LeanCloud.Realtime.LCIMClient.OnPaused
getset

Occurs when the connection is lost.

◆ OnResume

Action LeanCloud.Realtime.LCIMClient.OnResume
getset

Occurs when the connection is recovered.

◆ OnUnblocked

Action<LCIMConversation, string> LeanCloud.Realtime.LCIMClient.OnUnblocked
getset

Occurs when the current user is removed from the blacklist of a conversation.

◆ OnUnreadMessagesCountUpdated

Action<ReadOnlyCollection<LCIMConversation> > LeanCloud.Realtime.LCIMClient.OnUnreadMessagesCountUpdated
getset

Occurs when the number of unreadMessagesCount is updatded.

◆ Tag

string LeanCloud.Realtime.LCIMClient.Tag
get

Client tag.


The documentation for this class was generated from the following file: