Skip to main content

CometChat iOS SDK Documentation Review Report

Review Date: February 17, 2026
SDK Version: 4.x (v4.0.0+)
Reviewer: Documentation Verification System
Verification Method: SDK Swift Interface Analysis (CometChatSDK.swiftinterface)

Executive Summary

This report documents the comprehensive review of CometChat iOS SDK documentation against the actual SDK implementation. The SDK is distributed as a binary XCFramework, so verification was performed by analyzing the public Swift interface file (CometChatSDK.swiftinterface) which contains all public API signatures. The review focused on:
  1. Method signature accuracy
  2. Success/Failure response documentation
  3. Data model completeness (BaseMessage, User, Group, Conversation)
  4. Error codes and scenarios

1. Data Models - Complete Property Documentation

1.1 BaseMessage Class

All message types (TextMessage, MediaMessage, CustomMessage, InteractiveMessage, Call) inherit from BaseMessage.
PropertyTypeDescription
idIntServer-assigned unique message identifier
muidStringClient-generated unique identifier (Message UID)
senderUidStringUID of the message sender
receiverUidStringUID of the receiver (user or group)
messageTypeMessageTypeType of message (text, image, video, audio, file, custom)
receiverTypeReceiverTypeType of receiver (.user or .group)
sentAtIntUnix timestamp (seconds) when message was sent
deliveredAtDoubleUnix timestamp when message was delivered
readAtDoubleUnix timestamp when message was read
deliveredToMeAtDoubleUnix timestamp when delivered to current user
readByMeAtDoubleUnix timestamp when read by current user
updatedAtDoubleUnix timestamp of last update
statusStringMessage status
messageCategoryMessageCategoryCategory (message, action, call, custom)
senderUser?User object of the sender
receiverAppEntity?User or Group object of the receiver
metaData[String: Any]?Custom metadata dictionary
editedAtDoubleUnix timestamp when edited
editedByStringUID of user who edited
deletedAtDoubleUnix timestamp when deleted
deletedByStringUID of user who deleted
conversationIdStringUnique conversation identifier
parentMessageIdIntParent message ID (for threaded messages)
replyCountIntNumber of replies to this message
unreadRepliesCountIntNumber of unread replies
mentionedMeBoolWhether current user is mentioned
mentionedUsers[User]Array of mentioned users
reactions[ReactionCount]Array of reaction counts
receipts[MessageReceipt]Array of message receipts
quotedMessageIdIntID of quoted message
quotedMessageBaseMessage?The quoted message object
rawMessage[String: Any]?Raw JSON message data

1.2 TextMessage Class (extends BaseMessage)

PropertyTypeDescription
textStringThe text content of the message
tags[String]?Array of message tags
moderationStatusStringContent moderation status
Constructor:
TextMessage(receiverUid: String, text: String, receiverType: ReceiverType)

1.3 MediaMessage Class (extends BaseMessage)

PropertyTypeDescription
attachmentAttachment?Single attachment object
attachments[Attachment]?Array of attachments (multiple files)
captionString?Caption text for the media
filePathString?Local file path
filePaths[String]?Array of local file paths
files[File]?Array of File objects
tags[String]?Array of message tags
moderationStatusStringContent moderation status
Constructors:
MediaMessage(receiverUid: String, fileurl: String?, messageType: MessageType, receiverType: ReceiverType)
MediaMessage(receiverUid: String, files: [File], messageType: MessageType, receiverType: ReceiverType)

1.4 CustomMessage Class (extends BaseMessage)

PropertyTypeDescription
customData[String: Any]?Custom JSON data
typeString?Custom message type identifier
subTypeString?Custom message subtype
conversationTextString?Text for conversation list display
updateConversationBoolWhether to update conversation list
sendNotificationBoolWhether to send push notification
tags[String]?Array of message tags
Constructors:
CustomMessage(receiverUid: String, receiverType: ReceiverType, customData: [String: Any])
CustomMessage(receiverUid: String, receiverType: ReceiverType, customData: [String: Any], type: String?)

1.5 User Class

PropertyTypeDescription
uidString?Unique user identifier
nameString?Display name
avatarString?Avatar image URL
linkString?Profile link URL
roleString?User role
metadata[String: Any]?Custom metadata
statusUserStatusOnline status (.online, .offline)
statusMessageString?Custom status message
lastActiveAtDoubleLast active timestamp
hasBlockedMeBoolWhether user has blocked current user
blockedByMeBoolWhether current user has blocked this user
deactivatedAtDoubleDeactivation timestamp
tags[String]Array of user tags
Constructor:
User(uid: String, name: String)

1.6 Group Class

PropertyTypeDescription
guidStringUnique group identifier
nameString?Group name
iconString?Group icon URL
groupDescriptionString?Group description
ownerString?Owner’s UID
groupTypegroupTypeType (.public, .private, .password)
passwordString?Password for protected groups
metadata[String: Any]?Custom metadata
createdAtIntCreation timestamp
updatedAtIntLast update timestamp
joinedAtIntWhen current user joined
scopeGroupMemberScopeTypeCurrent user’s scope
hasJoinedBoolWhether current user has joined
membersCountIntTotal member count
tags[String]Array of group tags
isBannedFromGroupBoolWhether current user is banned
Constructors:
Group(guid: String, name: String, groupType: groupType, password: String?)
Group(guid: String, name: String, groupType: groupType, password: String?, icon: String, description: String)

1.7 Conversation Class

PropertyTypeDescription
conversationIdString?Unique conversation identifier
conversationTypeConversationTypeType (.user, .group, .none)
lastMessageBaseMessage?Last message in conversation
conversationWithAppEntity?User or Group object
unreadMessageCountIntNumber of unread messages
updatedAtDoubleLast update timestamp
tags[String]?Conversation tags
unreadMentionsCountIntUnread mentions count
lastReadMessageIdIntLast read message ID
latestMessageIdIntLatest message ID

1.8 Attachment Class

PropertyTypeDescription
fileNameStringName of the file
fileExtensionStringFile extension
fileSizeDoubleFile size in bytes
fileMimeTypeStringMIME type
fileUrlStringURL of the file
Constructor:
Attachment(fileName: String, fileExtension: String, fileMimeType: String, fileUrl: String)

1.9 MessageReceipt Class

PropertyTypeDescription
receiverIdStringReceiver identifier
receiverTypeReceiverTypeType of receiver
messageIdStringMessage identifier
senderUser?User who sent the receipt
receiptTypeReceiptTypeType (.delivered, .read, .deliveredToAll, .readByAll, .unread)
timeStampIntReceipt timestamp
deliveredAtDoubleDelivery timestamp
readAtDoubleRead timestamp

1.10 CometChatException Class

PropertyTypeDescription
errorCodeStringError code identifier
errorDescriptionStringHuman-readable error description

2. API Success/Failure Responses

2.1 CometChat.init()

Success Response:
onSuccess: { (isSuccess: Bool) in
    // isSuccess: true when SDK initializes successfully
    // After success: CometChat.isInitialised returns true
}
Failure Response:
onError: { (error: CometChatException) in
    // error.errorCode: String - Error identifier
    // error.errorDescription: String - Human-readable description
}
Common Error Codes:
Error CodeDescription
ERR_INVALID_APP_IDInvalid App ID provided
ERR_INVALID_REGIONInvalid region specified

2.2 CometChat.login()

Success Response:
onSuccess: { (user: User) in
    // Returns complete User object with all properties
    // See User class properties above
}
Failure Response:
onError: { (error: CometChatException) in
    // error.errorCode: String
    // error.errorDescription: String
}
Common Error Codes:
Error CodeDescription
ERR_UID_NOT_FOUNDUser with specified UID does not exist
ERR_INVALID_API_KEYInvalid API key provided
ERR_USER_DEACTIVATEDUser account is deactivated
ERR_NOT_LOGGED_INNo user is currently logged in

2.3 CometChat.sendTextMessage()

Success Response:
onSuccess: { (message: TextMessage) in
    // Returns TextMessage with server-assigned ID
    // message.id: Server-assigned message ID
    // message.sentAt: Server timestamp
    // All BaseMessage properties populated
}
Failure Response:
onError: { (error: CometChatException?) in
    // error?.errorCode: String
    // error?.errorDescription: String
}
Common Error Codes:
Error CodeDescription
ERR_NOT_LOGGED_INUser not logged in
ERR_UID_NOT_FOUNDReceiver UID not found
ERR_GUID_NOT_FOUNDGroup GUID not found
ERR_BLOCKED_BY_RECEIVERBlocked by receiver
ERR_NOT_A_MEMBERNot a member of the group

2.4 CometChat.sendMediaMessage()

Success Response:
onSuccess: { (message: MediaMessage) in
    // Returns MediaMessage with attachment details
    // message.attachment: Contains file URL after upload
    // message.attachments: For multiple files
}
Failure Response:
onError: { (error: CometChatException?) in
    // Same error structure as sendTextMessage
}

2.5 CometChat.sendCustomMessage()

Success Response:
onSuccess: { (message: CustomMessage) in
    // Returns CustomMessage with customData preserved
}

2.6 MessagesRequest.fetchPrevious() / fetchNext()

Success Response:
onSuccess: { (messages: [BaseMessage]?) in
    // Returns array of BaseMessage subclasses
    // Each message can be: TextMessage, MediaMessage, CustomMessage, 
    // ActionMessage, Call, InteractiveMessage
    // Use type checking to determine specific type
}
Failure Response:
onError: { (error: CometChatException?) in
    // error?.errorCode: String
    // error?.errorDescription: String
}

2.7 ConversationRequest.fetchNext()

Success Response:
onSuccess: { (conversations: [Conversation]) in
    // Returns array of Conversation objects
    // Each conversation contains lastMessage and conversationWith
}

2.8 UsersRequest.fetchNext()

Success Response:
onSuccess: { (users: [User]) in
    // Returns array of User objects
}

2.9 GroupsRequest.fetchNext()

Success Response:
onSuccess: { (groups: [Group]) in
    // Returns array of Group objects
}

2.10 CometChat.logout()

Success Response:
onSuccess: { (response: String) in
    // response: Success message string
}
Failure Response:
onError: { (error: CometChatException) in
    // error.errorCode: String
    // error.errorDescription: String
}

3. Complete Error Codes Reference

Error CodeDescriptionCommon Scenario
ERR_NOT_LOGGED_INUser is not logged inCalling API before login
ERR_UID_NOT_FOUNDUser ID not foundInvalid receiver UID
ERR_GUID_NOT_FOUNDGroup ID not foundInvalid group GUID
ERR_INVALID_API_KEYInvalid API keyWrong auth key
ERR_INVALID_APP_IDInvalid App IDWrong app ID
ERR_INVALID_REGIONInvalid regionWrong region code
ERR_BLOCKED_BY_RECEIVERBlocked by receiverSending to user who blocked you
ERR_USER_DEACTIVATEDUser account deactivatedLogin with deactivated account
ERR_INVALID_MESSAGE_IDInvalid message IDWrong message ID for edit/delete
ERR_ALREADY_JOINEDAlready joined the groupJoining group already member of
ERR_NOT_A_MEMBERNot a member of the groupSending to group not joined
ERR_WRONG_PASSWORDWrong group passwordIncorrect password for protected group
ERR_GROUP_NOT_JOINEDGroup not joinedAccessing group without joining
ERR_PERMISSION_DENIEDPermission deniedInsufficient permissions

4. Enums Reference

4.1 ReceiverType

enum ReceiverType: Int {
    case user = 0
    case group = 1
}

4.2 MessageType

enum MessageType: Int {
    case text = 0
    case image = 1
    case video = 2
    case audio = 3
    case file = 4
    case custom = 5
    case groupMember = 6
    case assistant = 7
    case toolResult = 8
    case toolArguments = 9
}

4.3 MessageCategory

enum MessageCategory: Int {
    case message = 0
    case action = 1
    case call = 2
    case custom = 3
    case interactive = 4
}

4.4 UserStatus

enum UserStatus: Int {
    case online = 0
    case offline = 1
}

4.5 ConversationType

enum ConversationType: Int {
    case user = 0
    case group = 1
    case none = 2
}

4.6 GroupType

enum groupType: Int {
    case `public` = 0
    case `private` = 1
    case password = 2
}

4.7 GroupMemberScopeType

enum GroupMemberScopeType: Int {
    case admin = 0
    case moderator = 1
    case participant = 2
}

5. Documentation Changes Summary

5.1 Files Updated

FileChanges Made
overview.mdxAdded Quick Reference section
setup.mdxAdded Quick Reference section
send-message.mdxAdded Quick Reference section
receive-message.mdxAdded Quick Reference section
All 94 SDK iOS docsAdded AI Agent Quick Reference sections
  1. Add Success/Failure Response Tables to each API documentation page
  2. Add BaseMessage Properties Reference to messaging-overview.mdx
  3. Add Error Codes Reference Page as a new document
  4. Add Data Models Reference Page documenting all classes

6. Verification Status

CategoryStatusNotes
Method Signatures✅ VerifiedAll match SDK interface
Data Models✅ DocumentedComplete property lists
Error Codes✅ DocumentedCommon codes listed
Success Responses✅ DocumentedReturn types specified
Failure Responses✅ DocumentedException structure documented

7. Conclusion

The CometChat iOS SDK documentation has been verified against the actual SDK implementation. The documentation is accurate for method signatures and usage patterns. This report adds comprehensive documentation for:
  1. Complete data model properties
  2. Success/failure response structures
  3. Error codes and scenarios
  4. Enum values and their meanings
With these additions, any AI or developer should be able to build a complete working app by following only the documentation.
Report generated by Documentation Verification System