Messages
Last updated
Last updated
You can use the methods from the TapCoreMessageManager class to manage chat messages.
Method Name | Description |
---|---|
ROOM_ID: (String) room ID value MESSAGE_IDs: (Arrray) array of messageID FOR_EVERYONE: (boolean) message model of message you want to quoted
MESSAGE_BODY: (String) message body for message model ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
FILE: (Object) the image file to be uploaded CAPTION: (String) the image's caption to be displayed in message bubble ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
FILE: (Object) the video file to be uploaded CAPTION: (String) the image's caption to be displayed in message bubble ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
FILE: (Object) the file to be uploaded CAPTION: (String) the image's caption to be displayed in message bubble ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
LATITUDE: (Number) latitude of the shared location LONGITUDE: (Number) longitude of the shared location ADDRESS: (String) text data containing the location address ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
FILE: (Object) the voice note file to be uploaded DURATION: (Number) the playback duration of the voice note file ROOM: (Object) room model for message model QUOTED_MESSAGE: (Object) message model of message you want to quoted FORWARD_MESSAGE: (Object) message model of message you want to forward FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message QUOTE_TITLE: (String) custom text for message.quote.title
MESSAGE_BODY: (String) message body for message model
ROOM: (Object) room model for message model
URLS: (NSArray<String>) list of URLs contained in the message
TITLE: (String) og:title
metadata of the specified URL
DESCRIPTION: (String) og:description
metadata of the specified URL
IMAGE: (String) og:image
metadata of the specified URL
SITE_NAME: (String) og:site_name
metadata of the specified URL
TYPE: (String) og:type
metadata of the specified URL
QUOTED_MESSAGE: (Object) message model of message you want to quoted
FORWARD_MESSAGE: (Object) message model of message you want to forward
FORWARD_ONLY: (boolean) set to true when you only need to forward an existing message without sending a new message
QUOTE_TITLE: (String) custom text for message.quote.title
To send a forwarded message to a chat room, use the sendForwardMessage()
method from the TapCoreMessageManager class.
Parameters
ROOM_MODEL
: (TAPRoomModel) the destination room where the message will be sent
CALLBACK
: (Method) callback method
FORWARD_MESSAGES
: (Array) array of forward messages
To send multiple forwarded message to multiple chat room, use the sendForwardMessagesOnMultipleRooms()
method from the TapCoreMessageManager class.
Parameters
DATA
: (Array) array of room and forward messages
CALLBACK
: (Method) callback method
MESSAGE_BODY: (String) message body for message model ROOM: (Object) room model for message model MESSAGE_TYPE: (Number) message type for message model MESSAGE_DATA: (Object) data object for message model LOCAL_ID: (String) custom value for preference local id default is null FORWARD_MESSAGE: (Object) message model of message you want to forward
MESSAGE_BODY: (String) message body for message model ROOM: (Object) room model for message model MESSAGE_TYPE: (Number) message type for message model MESSAGE_DATA: (Object) data object for message model LOCAL_ID: (String) custom value for preference local id default is null QUOTED_MESSAGE: (Object) message model of message you want to quoted QUOTE_TITLE: (String) title for your quoted message default is false QUOTE_CONTENT: (String) content for your quoted message default is false QUOTED_IMAGE_URL: (String) image url for your quoted message default is false
MESSAGE_MODEL: (Object) message model for your message
To edit amessage in a chat room, use the sendEmitWithEditedMessage()
method from the TapCoreMessageManager class.
Parameters
MESSAGE
: (Object) message model of the edit message
NEW_MESSAGE
: (String) new message value
CALLBACK
: (Method) callback method
Call this method to search messages from the chat room with a keyword.
KEYWORD: (String) message keyword ROOM_ID: (number) room id CALLBACK: (Object) callback method
Call this method to search messages from all chat room with a keyword.
KEYWORD: (String) message keyword CALLBACK: (Object) callback method
You may use these methods to mark a message or multiple messages as starred.
ROOM_ID: (Number) room id MESSAGE_IDs: (Array) array of message id CALLBACK: (Object) object of callback methods
You may use these methods to remove messages from the starred list.
ROOM_ID: (Number) room id MESSAGE_IDs: (Array) array of message id CALLBACK: (Object) object of callback methods
You can use the method below get a list of message IDs marked as starred by the user.
ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods
You can use the method below get a list of message IDs marked as starred by the user.
ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods
You may use this method to fetch shared content messages from the server. This currently includes image, video, file, and link messages.
ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods MAX_CREATED: (Number) the highest created time of the shared content to be retrieved MIN_CREATED: (Number) the lowest created time of the shared content to be retrieved SORT: (String) sorting order (fill with "ASC" or "DESC"), default value is "ASC"
You can fetch pinned messages list with this method below.
ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods
You can fetch all pinned messages ID list with this method below.
ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods
You can set pin messages with this method below.
ROOM_ID: (Number) room id MESSAGES: (Array) arrays of message model CALLBACK: (Object) object of callback methods
You can set pin messages with this method below.
ROOM_ID: (Number) room id MESSAGES_IDs: (Array) arrays of message ID IS_UNPIN_ALL: (Boolean) set true if unpin all message CALLBACK: (Object) object of callback methods
To start a file download from a File, Image, or Video message, you can use the downloadMessageFile()
method.
Parameters
MESSAGE
: (TAPMessageModel) pending message with ongoing file upload
To manually mark a message as read, call the markMessageAsRead()
method.
Parameters
ARRAY_OF_MESSAGE_ID: (TAPMessageModel) existing message to be marked as read
To manually mark a message as delivered, call the markMessageAsDelivered()
method.
Parameters
ARRAY_OF_MESSAGE_ID: (TAPMessageModel) existing message to be marked as read
To retrieve older messages in a chat room from the server, use the getOlderMessagesBeforeTimestamp()
method.
To retrieve newer messages in a chat room from the server, use the getNewerMessagesAfterTimestamp()
method.
Get total read count of a message
Parameters
MESSAGE_ID
: (Number) message id
CALLBACK
: (Object) object of callback method
Fetch message info (read by and delivere to).
Parameters
MESSAGE_ID
: (Number) message id
CALLBACK
: (Object) object of callback method
Send a new text message to the selected chat room.
Send a new image message to the selected chat room.
Send a new video message to the selected chat room.
Send a new file message to the selected chat room.
Send a new message with location to the selected chat room.
Send a new voice message to the selected chat room.
Send a new link message to the selected chat room.
Forward an existing message to the selected chat room.
Construct a customized TapTalk.io message model.
Send a new custom message to the room defined in the message model.
Edit the contents of the selected message
Call this method to search messages from the device's local storage with a keyword
Set message as starred or remove star from message for the active user.
Retrieve list of messages marked as starred in a chat room.
Set message as pinned or remove pin from message for all room participants.
Retrieve list of pinned messages in a chat room.
Retrieve image, video, file, and link messages from a chat room.
Start a file download from the selected file, image, or video message.
Mark message as read by the active user.
Mark message as delivered by the active user.
Retrieve messages that are older than the provided timestamp from the server to the selected chat room.
Retrieve newer messages from the server to the selected chat room
Retrieve existing media messages from a chat room