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:
 

Properties

NSString * chatId
 
NSString * content
 
BBMChatMessage_Datadata
 
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
 
BBMChatresolvedChatId
 
BBMUserresolvedSenderUri
 
- Properties inherited from BBMElement
BBMElementState bbmState
 
NSString * primaryKey
 
- Properties inherited from BBMElementBase
BBMContainerparentContainer
 

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
readnonatomicstrong

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

◆ content

- (NSString*) content
readnonatomicstrong

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

◆ data

- (BBMChatMessage_Data*) data
readnonatomicstrong

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
readnonatomicstrong

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
readnonatomicassign

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
readnonatomicstrong

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
readnonatomicassign

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
readnonatomicstrong

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
readnonatomicassign

This field indicates the recall state of the message.

◆ senderUri

- (NSString*) senderUri
readnonatomicstrong

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

◆ state

- (BBMChatMessageState) state
readnonatomicassign

This field indicates the overall delivery state of the message.

◆ stateIsPartial

- (BOOL) stateIsPartial
readnonatomicassign

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

◆ tag

- (NSString*) tag
readnonatomicstrong

Indicates the type of content this message represents.

◆ thumb

- (NSString*) thumb
readnonatomicstrong

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

◆ timestamp

- (unsigned long long) timestamp
readnonatomicassign

Holds the POSIX timestamp of the message.