|
Chat SDK for Unity and Windows v1.3.1
|
Public Member Functions | |
| void | AddContact (string userId, string reason=null, CallBack callback=null) |
| void | DeleteContact (string userId, bool keepConversation=false, CallBack callback=null) |
| void | GetAllContactsFromServer (ValueCallBack< List< string > > callback=null) |
| List< string > | GetAllContactsFromDB () |
| void | AddUserToBlockList (string userId, CallBack callback=null) |
| void | RemoveUserFromBlockList (string userId, CallBack callback=null) |
| void | GetBlockListFromServer (ValueCallBack< List< string > > callback=null) |
| List< string > | GetBlockListFromDB () |
| void | AcceptInvitation (string userId, CallBack callback=null) |
| void | DeclineInvitation (string userId, CallBack callback=null) |
| void | GetSelfIdsOnOtherPlatform (ValueCallBack< List< string > > callback=null) |
| void | SetContactRemark (string userId, string remark, CallBack callback=null) |
| Contact | FetchContactFromLocal (string userId) |
| void | FetchAllContactsFromLocal (ValueCallBack< List< Contact > > callback=null) |
| void | FetchAllContactsFromServer (ValueCallBack< List< Contact > > callback=null) |
| void | FetchAllContactsFromServerByPage (int limit=20, string cursor=null, ValueCallBack< CursorResult< Contact > > callback=null) |
| void | AddContactManagerDelegate (IContactManagerDelegate contactManagerDelegate) |
| void | RemoveContactManagerDelegate (IContactManagerDelegate contactManagerDelegate) |
The contact manager class, which manages chat contacts such as adding, retrieving, and deleting contacts.
| void AgoraChat.ContactManager.AddContact | ( | string | userId, |
| string | reason = null, |
||
| CallBack | callback = null |
||
| ) |
Adds a new contact.
This is an asynchronous method.
| userId | The user ID of the contact to add. |
| reason | The invitation message. This parameter is optional and can be set to null or "". |
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.DeleteContact | ( | string | userId, |
| bool | keepConversation = false, |
||
| CallBack | callback = null |
||
| ) |
Deletes a contact and all the related conversations.
This is an asynchronous method.
| userId | The user ID of the contact to delete. |
| keepConversation | Whether to retain conversations of the contact to delete.
|
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.GetAllContactsFromServer | ( | ValueCallBack< List< string > > | callback = null | ) |
Gets the contact list from the server.
This is an asynchronous method.
| callback | The result callback. If success, the SDK returns the list of contacts; if a failure occurs, the SDK returns the error information. See ValueCallBack. |
| List< string > AgoraChat.ContactManager.GetAllContactsFromDB | ( | ) |
Gets the contact list from the local database.
| void AgoraChat.ContactManager.AddUserToBlockList | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
Adds a contact to the block list. You can send messages to the users on the block list, but cannot receive messages from them.
This is an asynchronous method.
| userId | The user ID of the contact to be added to the block list. |
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.RemoveUserFromBlockList | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
Removes the contact from the block list.
This is an asynchronous method.
| userId | The user ID of the contact to be removed from the block list. |
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.GetBlockListFromServer | ( | ValueCallBack< List< string > > | callback = null | ) |
Gets the block list from the server.
This is an asynchronous method.
| callback | The result callback. If success, the SDK returns the block list; if a failure occurs, the SDK returns the error information. See ValueCallBack. |
| List< string > AgoraChat.ContactManager.GetBlockListFromDB | ( | ) |
Gets the local blocklist.
| void AgoraChat.ContactManager.AcceptInvitation | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
Accepts a friend invitation.
This an asynchronous method.
| userId | The user who initiates the friend invitation. |
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.DeclineInvitation | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
Declines a friend invitation.
This an asynchronous method.
| userId | The user who initiates the friend invitation. |
| callback | The result callback. See CallBack. |
| void AgoraChat.ContactManager.GetSelfIdsOnOtherPlatform | ( | ValueCallBack< List< string > > | callback = null | ) |
Gets the unique IDs of the current user on the other devices.
The ID is in the format of user ID + "/" + resource.
This is an asynchronous method.
| callback | The result callback. If success, the SDK returns the unique IDs of the current user on the other devices; if a failure occurs, the SDK returns the error information. See ValueCallBack. |
| void AgoraChat.ContactManager.SetContactRemark | ( | string | userId, |
| string | remark, | ||
| CallBack | callback = null |
||
| ) |
Set remark for the userId.
This is an asynchronous method.
| userId | User ID to set a remark for. |
| remark | Remark to be set. |
| callback | The result callback. See CallBack. |
| Contact AgoraChat.ContactManager.FetchContactFromLocal | ( | string | userId | ) |
Fetch contact information from the local database. Return null if the contact information is not obtained.
This is an synchronous method.
| userId | User ID. |
| callback | The result callback. See ValueCallBack. |
| void AgoraChat.ContactManager.FetchAllContactsFromLocal | ( | ValueCallBack< List< Contact > > | callback = null | ) |
Fetch all contact information from the local database.
This is an asynchronous method.
| callback | The result callback. See ValueCallBack. |
| void AgoraChat.ContactManager.FetchAllContactsFromServer | ( | ValueCallBack< List< Contact > > | callback = null | ) |
Fetch all contact information from server.
This is an asynchronous method.
| callback | The result callback. See ValueCallBack. |
| void AgoraChat.ContactManager.FetchAllContactsFromServerByPage | ( | int | limit = 20, |
| string | cursor = null, |
||
| ValueCallBack< CursorResult< Contact > > | callback = null |
||
| ) |
Fetch all contact information from the server in page form.
This is an asynchronous method.
| limit | The number of contact that you expect to get on each page. The value range is [1,50]. |
| cursor | The cursor position from which to start querying data. |
| callback | The result callback. See ValueCallBack. |
| void AgoraChat.ContactManager.AddContactManagerDelegate | ( | IContactManagerDelegate | contactManagerDelegate | ) |
Adds a contact listener.
| contactManagerDelegate | The contact listener to add. It is inherited from IContactManagerDelegate. |
| void AgoraChat.ContactManager.RemoveContactManagerDelegate | ( | IContactManagerDelegate | contactManagerDelegate | ) |
Removes a contact listener.
| contactManagerDelegate | The contact listener to remove. It is inherited from IContactManagerDelegate. |