ParametersGROUP_NAME: (String) your group name
PARTICIPANTS_USERID_ARRAY: (Array) list of participant userIDs
PROFILE_PICTURE: (UIImage) group picture image
ParametersGROUP_IMAGE: (UIImage) image of group profile
GROUP_ROOM_ID: (String) room ID of group
Delete Local Group Chat Room
Delete group chat room from the device's local storage and clear all chat data and participants. Locally deleted room data will still be accessible from the server if the user remains a participant in the room.
ParametersGROUP_ROOM_ID: (String) room ID of group
Send Text Message
To send a text message to a chat room, use the sendTextMessage:room:start:success:failure: method from the TapCoreMessageManager class.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send text message[[TAPCoreMessageManager sharedManager] sendTextMessage:MESSAGE_BODY room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the sendTextMessage:quotedMessage:room:start:success:failure: method to send a text message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send text message with quote[[TAPCoreMessageManager sharedManager] sendTextMessage:MESSAGE_BODY quotedMessage:QUOTED_MESSAGE room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersMESSAGE_BODY: (String) content of the message
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
Send Location Message
You can send a location embedded in a chat message using sendLocationMessageWithLatitude:longitude:address:room:start:success:failure:. This method takes latitude, longitude, and address text as parameters.
Use the sendLocationMessageWithLatitude:longitude:quotedMessage:address:room:start:success:failure: method to send a location message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send location message with quote[[TAPCoreMessageManager sharedManager] sendLocationMessageWithLatitude:LATITUDE longitude:LONGITUDE quotedMessage:QUOTED_MESSAGE address:ADDRESS room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed }success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersLATITUDE: (Float) latitude of the shared location
LONGITUDE: (Float) longitude of the shared location
ADDRESS: (String) text data containing the location address
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
Send Image Message
To send an image to a chat room, you can use sendImageMessage: or sendImageMessageWithAsset: method by providing either UIImage, PHAsset , IMAGE_ASSET_URL, or IMAGE_URL as parameter.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using UIImage[[TAPCoreMessageManager sharedManager] sendImageMessage:IMAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using PHAsset[[TAPCoreMessageManager sharedManager] sendImageMessageWithAsset:IMAGE_ASSET caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using image asset URL[[TAPCoreMessageManager sharedManager] sendImageMessageWithURL:IMAGE_ASSET_URL caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using remote image URL[[TAPCoreMessageManager sharedManager] sendImageMessageWithRemoteUrl:IMAGE_URL caption:CAPTION room:ROOM fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the sendImageMessage: or sendImageMessageWithAsset: or sendImageMessageWithRemoteUrl: method with extra parameter to send an image message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using UIImage with quote[[TAPCoreMessageManager sharedManager] sendImageMessage:IMAGE quotedMessage:QUOTED_MESSAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using PHAsset with quote[[TAPCoreMessageManager sharedManager] sendImageMessageWithAsset:IMAGE_ASSET quotedMessage:QUOTED_MESSAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using image asset URL with quote[[TAPCoreMessageManager sharedManager] sendImageMessageWithURL:IMAGE_ASSET_URL quotedMessage:QUOTED_MESSAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Image upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send image using remote image URL with quote[[TAPCoreMessageManager sharedManager] sendImageMessageWithRemoteUrl:IMAGE_URL caption:CAPTION room:ROOM quotedMessage:QUOTED_MESSAGE fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersIMAGE: (UIImage) selected image with UIImage type
IMAGE_ASSET: (PHAsset) selected image asset data
IMAGE_ASSET_URL: (NSURL) local URL of the image asset
IMAGE_URL: (String) remote URL of the image
CAPTION: (String) caption for the image
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
FETCH_METADATA: (BOOL) inserts metadata from remote URL to the constructed message when true
Send Video Message
To send a video to a chat room, you can use sendVideoMessageWithAsset: method by providing the VIDEO_ASSET, VIDEO_ASSET_URL, or a remote VIDEO_URL as parameter.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using video asset (PHAsset)[[TAPCoreMessageManager sharedManager] sendVideoMessageWithAsset:VIDEO_ASSET caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Video upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using video asset URL[[TAPCoreMessageManager sharedManager] sendVideoMessageWithVideoAssetURL:VIDEO_ASSET_URL caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Video upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using remote video URL[[TAPCoreMessageManager sharedManager] sendVideoMessageWithRemoteUrl:VIDEO_URL caption:CAPTION room:ROOM fetchMetaData:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the send video method with extra parameter to send a video message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using video asset (PHAsset) with quote[[TAPCoreMessageManager sharedManager] sendVideoMessageWithAsset:VIDEO_ASSET quotedMessage:QUOTED_MESSAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Video upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using video asset URL with quote[[TAPCoreMessageManager sharedManager] sendVideoMessageWithVideoAssetURL:VIDEO_ASSET_URL quotedMessage:QUOTED_MESSAGE caption:CAPTION room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// Video upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send video using remote video URL with quote[[TAPCoreMessageManager sharedManager] sendVideoMessageWithRemoteUrl:VIDEO_URL caption:CAPTION room:ROOM quotedMessage:QUOTED_MESSAGE fetchMetaData:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersVIDEO_ASSET: (PHAsset) selected videos asset data
VIDEO_ASSET_URL: (NSURL) local URL of the video asset
VIDEO_URL: (String) remote URL of the video
CAPTION: (String) caption for the video
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
FETCH_METADATA: (BOOL) inserts metadata from remote URL to the constructed message when true
Send File Message
You can also send a file to a chat room using sendFileMessageWithFileURI: or sendFileMessageWithRemoteUrl:.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using file asset URL[[TAPCoreMessageManager sharedManager] sendFileMessageWithFileURI:FILE_ASSET_URL room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed} progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// File upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using remote file URL[[TAPCoreMessageManager sharedManager] sendFileMessageWithRemoteUrl:FILE_URL caption:CAPTION room:ROOM fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using remote file URL, file name, and mime type[[TAPCoreMessageManager sharedManager] sendFileMessageWithRemoteUrl:FILE_URL caption:CAPTION room:ROOM fileName:FILE_NAME mimeType:MIME_TYPE fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the send file method with extra parameter to send a file message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using file asset URL with quote[[TAPCoreMessageManager sharedManager] sendFileMessageWithFileURI:FILE_ASSET_URL quotedMessage:QUOTED_MESSAGE room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed} progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// File upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using remote file URL with quote[[TAPCoreMessageManager sharedManager] sendFileMessageWithRemoteUrl:FILE_URL caption:CAPTION room:ROOM quotedMessage:QUOTED_MESSAGE fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send file using remote file URL, file name, and mime type with quote[[TAPCoreMessageManager sharedManager] sendFileMessageWithRemoteUrl:FILE_URL caption:CAPTION room:ROOM quotedMessage:QUOTED_MESSAGE fileName:FILE_NAME mimeType:MIME_TYPE fetchMetadata:FETCH_METADATAtemporaryMessageCreated:^(TAPMessageModel * _Nonnull message) {// Temporary message was created while fetching metadata// This callback will be called when FETCH_METADATA is true}start:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersFILE_ASSET_URL: (NSURL) file path of the selected file
FILE_URL: (String) remote URL of the video
CAPTION: (String) caption for the video
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
FILE_NAME: (String) file name to be included in message data
MIME_TYPE: (String) mime type to be included in message data, set to empty to fetch default mime type from the provided URL
FETCH_METADATA: (BOOL) inserts metadata from remote URL to the constructed message when true
Send Voice Message
You can also send a voice note to a chat room using the sendVoiceMessageWithFileURI: method with a provided FILE_URI (NSURL).
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>[[TAPCoreMessageManager sharedManager] sendVoiceMessageWithFileURI:AUDIO_ASSET_URL room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// File upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the sendVoiceMessageWithFileURI: method with extra parameter to send a voice message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>[[TAPCoreMessageManager sharedManager] sendVoiceMessageWithFileURI:AUDIO_ASSET_URL quotedMessage:QUOTED_MESSAGE room:ROOMstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}progress:^(TAPMessageModel * _Nullable message, CGFloat progress, CGFloat total) {// File upload is in progress}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
ParametersAUDIO_ASSET_URL: (NSURL) file path of the selected audio
CAPTION: (String) caption for the video
ROOM: (TAPRoomModel) the destination room where the message will be sent
QUOTED_MESSAGE: (TAPMessageModel) quote containing another existing message
Send Link Message
You can send a link message, which is usually composed of a text message with URL on the body, using the sendLinkMessage: method.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send link message[[TAPCoreMessageManager sharedManager] sendLinkMessage:MESSAGE_BODY room:ROOM urls:URLS title:TITLE description:DESCRIPTION image:IMAGEstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {//Failed send link message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send link message with additional metadata parameters[[TAPCoreMessageManager sharedManager] sendLinkMessage:MESSAGE_BODY room:ROOM urls:URLS title:TITLE description:DESCRIPTION image:IMAGE siteName:SITE_NAME type:TYPEstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
Use the sendLinkMessage: method with extra parameters to send a link message with quote.
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send link message with quote[[TAPCoreMessageManager sharedManager] sendLinkMessage:MESSAGE_BODY quotedMessage:QUOTED_MESSAGE room:ROOM urls:URLS title:TITLE description:DESCRIPTION image:IMAGEstart:^(TAPMessageModel * _Nonnull message) {// Message was constructed}success:^(TAPMessageModel * _Nonnull message) {// Message was sent successfully}failure:^(TAPMessageModel * _Nullable message, NSError * _Nonnull error) {// Failed to send message}];
// import TapTalk Message Manager#import<TapTalk/TAPCoreMessageManager.h>// Send link message with quote and additional metadata parameters[[TAPCoreMessageManager sharedManager] sendLinkMessage:MESSAGE_BODY quotedMessage:QUOTED_MESSAGE room:ROOM urls:URLS title:TITLE description:DESCRIPTION image:IMAGE siteName:SITE_NAME