BBM Enterprise iOS SDK  R3
BBMChatMessage Class Reference
Inheritance diagram for BBMChatMessage:
BBMElement BBMElementBase

Class Methods

(BBMChatMessageFileState) + valueForFileStateString:
(NSString *) + stringForFileStateValue:
(BBMChatMessageRecall) + valueForRecallString:
(NSString *) + stringForRecallValue:
(BBMChatMessageState) + valueForStateString:
(NSString *) + stringForStateValue:
(BOOL) + tagIsDefined:
- Class Methods inherited from BBMElement
(NSString *) + identifierOfElement:
(BBMElement *) + elementWithIdentifier:andParent:
(NSDictionary *) + primaryKeyDictionaryWithIdentifier:


NSString * chatId
NSString * content
NSDictionary * rawData
NSString * file
BBMChatMessageFileState fileState
NSString * flags
unsigned long long messageId
BBMChatMessageRecall recall
NSString * senderUri
BBMChatMessageState state
BOOL stateIsPartial
NSString * tag
NSString * thumb
unsigned long long timestamp
- Properties inherited from BBMElement
BBMElementState bbmState
NSString * primaryKey
- Properties inherited from BBMElementBase

Additional Inherited Members

- Instance Methods inherited from BBMElement
(id) - initWithParentContainer:
- Instance Methods inherited from BBMElementBase
(BBMDSModel *) - masterModel
(id) - objectForKeyedSubscript:

Detailed Description

Each element in this list is a message in a hosted chat. The primary key for each element is the 'chatId' and 'messageId'.

The range of valid message ids for a given chat can be found in the chat list as ['lastMessage'

  • 'numMessages', 'lastMessage'].

When a new message is added to a chat, bbmcore will first 'listAdd' the message entry, and then will 'listChange' the chat to update the 'lastMessage' and 'numMessages' fields.

Note that 'listRemove' is not supported for this list. The message counters maintained in the chat list indicate when messages have been removed from this list.

Method Documentation

◆ tagIsDefined:()

+ (BOOL) tagIsDefined: (NSString *)  tag

Returns YES iff the given tag is one defined in the BBMDS specification.

Property Documentation

◆ chatId

- (NSString*) chatId

The unique identifier of the chat to which this message belongs.

◆ content

- (NSString*) content

Holds the text content of the message, when the 'tag' has such a concept; otherwise omitted.

◆ data

- (BBMChatMessage_Data*) data

This field contains opaque data managed by the app that is sent with the message. Unless specifically noted, bbmcore does not examine or modify this JSON object.

This can contain a single JSON object, or it can not exist at all. It cannot contain any other JSON type.

Many 'tag' values have a corresponding object defined as a child of the 'data' object with a key equal to the 'tag'. All 'tags' with such a corresponding child of 'data' require that child to be present. Other tags have no such requirement.

The 'data' object can also contain other key-value pairs independently from the 'tag'.

◆ file

- (NSString*) file

A path to a large file that is not carried in the message. This file is uploaded or download by bbmcore automatically. For downloads, this will only be set once 'fileState' progresses to Done

◆ fileState

- (BBMChatMessageFileState) fileState

Indicates the state of file upload or download.

Generally, whether the transfer is an upload or download is not exposed to the app. However, some states imply that the transfer is a download that can be started or restarted by the 'chatMessageFileDownload' message. The 'incoming' 'flag' on this 'chatMessage' does not indicate whether the transfer is an upload or download.

Bbmcore automatically handles temporary errors during uploads and downloads. Such errors and the retries that occur are not exposed to the app. Eventually, bbmcore will give up and place a transfer into either the 'Failed' or 'FailedAvailable' state.

◆ flags

- (NSString*) flags

Compact read-only flags about the message. Each flag that is 'true' has its corresponding letter present in the string. Each flag that is 'false' has its corresponding letter not present in the string. The letters will always be provided in alphabetical order.

◆ messageId

- (unsigned long long) messageId

The unique identifier for this message. These are consecutive integers, ordered by arrival time. The range of valid integers for a given chat is stored in 'listChat's 'lastMessage' and 'numMessages' values.

◆ rawData

- (NSDictionary*) rawData

If the tag associated with this message is defined in the BBMDS specification, this property will be nil. If the tag is unrecognized, this property will hold a dictionary representing the JSON string sent by bbmcore in the 'data' property. The set of recognized tags can be obtained from the recognizedTags property.

◆ recall

- (BBMChatMessageRecall) recall

This field indicates the recall state of the message.

◆ senderUri

- (NSString*) senderUri

Holds the URI of the sender of this message. See the URIs section for information on the URI format.

◆ state

- (BBMChatMessageState) state

This field indicates the overall delivery state of the message.

◆ stateIsPartial

- (BOOL) stateIsPartial

This indicates whether or not the state applies to some (true) or all (false) recipients.

◆ tag

- (NSString*) tag

Indicates the type of content this message represents.

◆ thumb

- (NSString*) thumb

A path to a small file that is carried in the message.

◆ timestamp

- (unsigned long long) timestamp

Holds the POSIX timestamp of the message.