#import <AgoraConversation.h>
Delete all message of the conversation
- Returns
- Delete result, YES: mean success, NO: mean failure.
Mark all message as read
- Returns
- Result of mark all message as read, YES: mean success, NO: mean failure.
Update conversation extend properties to DB
- Returns
- Extend properties update result, YES: mean success, NO: mean failure.
Get latest message that received from others
- Returns
- Message instance
Insert a message to the tail of conversation, message's conversationId should equle to conversation's conversationId, message will be inserted to DB, and update conversation's property
- Parameters
-
- Returns
- Message insert result, YES: mean success, NO: mean failure.
Insert a message to the end of a conversation in local database. ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly.
- Parameters
-
- (void) deleteAllMessages: |
|
(AgoraError **) |
pError |
|
Delete all messages of the conversation from memory cache and local database
- Parameters
-
Delete a message
- Parameters
-
aMessageId | Message's ID who will be deleted |
- Returns
- Message delete result, YES: mean success, NO: mean failure.
Delete a message
- Parameters
-
aMessageId | Id of the message to be deleted |
pError | Error |
Insert a message to a conversation. ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly.
- Parameters
-
- Returns
- Message insert result, YES: mean success, NO: mean failure.
Insert a message to a conversation in local database and SDK will update the last message automatically ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly. The inserting message will be inserted based on timestamp. Method AgoraConversation insertMessage:error: = AgoraChatManager importMsessage:completion: + update conversation latest message
- Parameters
-
Get last received message
- Returns
- Message instance
- (void) loadCustomMsgWithKeyword: |
|
(NSString *) |
aKeyword |
timestamp: |
|
(long long) |
aTimestamp |
count: |
|
(int) |
aCount |
fromUser: |
|
(NSString *) |
aSender |
searchDirection: |
|
(MessageSearchDirection) |
aDirection |
completion: |
|
(void(^)(NSArray *aMessages, AgoraError *aError)) |
aCompletionBlock |
|
|
| |
Load custom messages with specified keyword from local database,returning messages are sorted by receiving timestamp based on MessageSearchDirection. If reference timestamp is negative, load from the latest messages; if message count is negative, will be handled as count=1
- Parameters
-
aKeyword | Search keyword. aKeyword=nil to ignore |
aTimestamp | load based on reference timestamp. If aTimestamp=-1, will load from the most recent (the latest) message |
aCount | Max number of messages to load |
aSender | Message sender (optional). Pass nil to ignore |
aDirection | Message search direction MessageSearchDirectionUp: get aCount of messages before aMessageId; MessageSearchDirectionDown: get aCount of messages after aMessageId * -— |
aCompletionBlock | The callback of completion block |
- (void) loadMessagesFrom: |
|
(long long) |
aStartTimestamp |
to: |
|
(long long) |
aEndTimestamp |
count: |
|
(int) |
aCount |
completion: |
|
(void(^)(NSArray *aMessages, AgoraError *aError)) |
aCompletionBlock |
|
|
| |
Load messages within specified time range from local database. Returning messages are sorted by sending timestamp
- Parameters
-
aStartTimestamp | Starting timestamp in miliseconds |
aEndTimestamp | Ending timestamp in miliseconds |
aCount | Max number of messages to load |
aCompletionBlock | The callback of completion block |
- (void) loadMessagesStartFromId: |
|
(NSString *) |
aMessageId |
count: |
|
(int) |
aCount |
searchDirection: |
|
(MessageSearchDirection) |
aDirection |
completion: |
|
(void(^)(NSArray *aMessages, AgoraError *aError)) |
aCompletionBlock |
|
|
| |
Load messages starting from the specified message id from local database. Returning messages are sorted by receiving timestamp based on MessageSearchDirection. If the aMessageId is nil, will return starting from the latest message
- Parameters
-
aMessageId | Start loading messages from the specified message id |
aCount | Max number of messages to load |
aDirection | Message search direction. MessageSearchDirectionUp: get aCount of messages before aMessageId; MessageSearchDirectionDown: get aCount of messages after aMessageId |
aCompletionBlock | The callback of completion block |
- (void) loadMessagesWithKeyword: |
|
(NSString *) |
aKeyword |
timestamp: |
|
(long long) |
aTimestamp |
count: |
|
(int) |
aCount |
fromUser: |
|
(NSString *) |
aSender |
searchDirection: |
|
(MessageSearchDirection) |
aDirection |
completion: |
|
(void(^)(NSArray *aMessages, AgoraError *aError)) |
aCompletionBlock |
|
|
| |
Load messages with specified keyword from local database, returning messages are sorted by receiving timestamp based on MessageSearchDirection. If reference timestamp is negative, load from the latest messages; if message count is negative, will be handled as count=1
- Parameters
-
aKeyword | Search keyword. aKeyword=nil to ignore |
aTimestamp | load based on reference timestamp. If aTimestamp=-1, will load from the most recent (the latest) message |
aCount | Max number of messages to load |
aSender | Message sender (optional). Pass nil to ignore |
aDirection | Message search direction MessageSearchDirectionUp: get aCount of messages before aMessageId; MessageSearchDirectionDown: get aCount of messages after aMessageId * -— |
aCompletionBlock | The callback of completion block |
- (void) loadMessagesWithType: |
|
(MessageBodyType) |
aType |
timestamp: |
|
(long long) |
aTimestamp |
count: |
|
(int) |
aCount |
fromUser: |
|
(NSString *) |
aUsername |
searchDirection: |
|
(MessageSearchDirection) |
aDirection |
completion: |
|
(void(^)(NSArray *aMessages, AgoraError *aError)) |
aCompletionBlock |
|
|
| |
Load messages with specified message type from local database. Returning messages are sorted by receiving timestamp based on MessageSearchDirection.
- Parameters
-
aType | Message type to load |
aTimestamp | load based on reference timestamp. If aTimestamp=-1, will load from the most recent (the latest) message |
aCount | Max number of messages to load. if aCount<0, will be handled as count=1 |
aUsername | Message sender (optional). Use aUsername=nil to ignore |
aDirection | Message search direction MessageSearchDirectionUp: get aCount of messages before aMessageId; MessageSearchDirectionDown: get aCount of messages after aMessageId |
aCompletionBlock | The callback of completion block |
Get a message with the ID
- Parameters
-
- Returns
- Message instance
Get a message with the ID
- Parameters
-
aMessageId | MessageID |
pError | Error |
- (NSArray *) loadMoreMessagesContain: |
|
(NSString *) |
aKeywords |
before: |
|
(long long) |
aTimestamp |
limit: |
|
(int) |
aLimit |
from: |
|
(NSString *) |
aSender |
direction: |
|
("Use -loadMessagesContainKeywords:timestamp:count:fromUser:searchDirection:completion: instead") |
__deprecated_msg |
|
|
| |
Get more messages contain specified keywords from DB, result messages are sorted by received time, if reference timestamp is negative, will fetch message from latest message, andd will fetch all messages that meet the condition if aLimit is negative
- Parameters
-
aKeywords | Search content, will ignore it if it's empty |
aTimestamp | Reference timestamp |
aLimit | Count of messages to load |
aSender | Message sender, will ignore it if it's empty |
aDirection | Message search direction |
- Returns
- Message NSArray<Message>
Load messages from DB in duration, result messages are sorted by receive time, user should limit the max count to load to avoid memory issue
- Parameters
-
aStartTimestamp | Start time's timestamp in miliseconds |
aEndTimestamp | End time's timestamp in miliseconds |
aMaxCount | Message search direction |
- Returns
- Message NSArray<Message>
Get more messages from DB, result messages are sorted by receive time, and NOT include the reference message, if reference messag's ID is nil, will fetch message from latest message
- Parameters
-
aMessageId | Reference message's ID |
aLimit | Count of messages to load |
aDirection | Message search direction |
- Returns
- Message NSArray<Message>
Get more messages with specified type from DB, result messages are sorted by received time, if reference timestamp is negative, will fetch message from latest message, andd will fetch all messages that meet the condition if aLimit is negative
- Parameters
-
aType | Message type to load |
aTimestamp | Reference timestamp |
aLimit | Count of messages to load |
aSender | Message sender, will ignore it if it's empty |
aDirection | Message search direction |
- Returns
- Message NSArray<Message>
- (void) markAllMessagesAsRead: |
|
(AgoraError **) |
pError |
|
Mark all messages as read
- Parameters
-
Mark a message as read
- Parameters
-
aMessageId | Message's ID who will be set read status |
- Returns
- Result of mark message as read, YES: mean success, NO: mean failure.
Mark a message as read
- Parameters
-
aMessageId | MessageID |
pError | Error |
Update a message, can't update message's messageId, conversation's latestMessage and so on properties will update after update the message
- Parameters
-
- Returns
- Message update result, YES: mean success, NO: mean failure.
Use this method to update a message in local database. Changing properties will affect data in database LatestMessage of the conversation and other properties will be updated accordingly. messageId of the message cannot be updated
- Parameters
-
- (NSString*) conversationId |
|
readnonatomiccopy |
conversation ID For single chat,conversation ID is to chat user's name For group chat, conversation ID is groupID(), different with getGroupName() For chat room, conversation ID is chatroom ID, different with chat room name() For help desk, it is same with single chat, conversationID is also chat user's name
Conversation extension property
Conversation latest message
- (AgoraConversationType) type |
|
readnonatomicassign |
- (int) unreadMessagesCount |
|
readnonatomicassign |
The documentation for this class was generated from the following file: