BlackBerry Spark Communications Services for iOS  1.11.0
BBMChat Class Reference
Inheritance diagram for BBMChat:
BBMElement BBMElementBase

Class Methods

(BBMChatInvitePolicy+ valueForInvitePolicyString:
 
(NSString *) + stringForInvitePolicyValue:
 
(BBMChatKeyState+ valueForKeyStateString:
 
(NSString *) + stringForKeyStateValue:
 
(BBMChatState+ valueForStateString:
 
(NSString *) + stringForStateValue:
 
- Class Methods inherited from BBMElementBase
(NSString *) + identifierOfElement:
 

Properties

NSString * chatId
 
NSDictionary * data
 
NSString * flags
 
BOOL isAdminFlagSet
 
BOOL isHiddenFlagSet
 
BOOL isMissingChatKeyFlagSet
 
BOOL isOneToOneFlagSet
 
BBMChatInvitePolicy invitePolicy
 
BBMChatKeyState keyState
 
unsigned long long lastActivity
 
unsigned long long lastMessage
 
NSDictionary * localData
 
NSString * mailboxId
 
unsigned long long numMessages
 
unsigned long long numUnread
 
NSDictionary * privateData
 
unsigned long long restorePoint
 
BBMChatState state
 
NSString * subject
 
- Properties inherited from BBMElement
BBMElementState bbmState
 
NSString * primaryKey
 
- Properties inherited from BBMElementBase
BBMContainerparentContainer
 The container (BBMLiveList or BBMLiveMap) holding this element. More...
 

Additional Inherited Members

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

Detailed Description

This list contains an entry for each chat the user is participating in. Chats are backed by the BlackBerry Infrastructure, and they will be restored when signing into an existing Spark Communications identity.

Chats must be started explicitly via the 'chatStart' message, and content may be added using the 'chatMessageSend' message.

When bbmcore issues a 'listRemove' for a chat, or when the 'numMessages' counter decreases, it is not necessary to also issue a separate 'listRemove' for the messages. Your application will cleanup their cache of the (now orphaned) messages when appropriate.

Since
R2

Property Documentation

◆ chatId

- (NSString*) chatId
readnonatomicstrong

The unique identifier for this chat. This is used as the value portion of chat URIs. See the URIs section for information on the URI format.

Since
R2

◆ data

- (NSDictionary*) data
readnonatomicstrong

This field contains opaque data managed by your application.This data can be read or written by any participant. Concurrent writes are resolved in a way that all participants will eventually see the same steady-state outcome.This field is suitable for shared chat metadata that changes infrequently such as a chat avatar URL, the identifiers of external resources associated with the chat, or a per-chat setting shared by all participants. Data that changes frequently should be sent to all participants via the 'data' field of 'chatMessage' instead.The the 'data', encoded as JSON in UTF-8, must not exceed 71680 bytes (70 KB).

Since
R6

◆ flags

- (NSString*) flags
readnonatomicstrong

Compact read-only flags about the chat. 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.

Since
R2

◆ invitePolicy

- (BBMChatInvitePolicy) invitePolicy
readnonatomicassign

The policy that controls who may invite participants to the chat. This only applies to chats that do not have the 'oneToOne' flag, in which case the field will always be present. The field will never be present for chats with the 'oneToOne' flag.

Since
R4

◆ isAdminFlagSet

- (BOOL) isAdminFlagSet
readnonatomicassign

The local user is an admin for the chat, and may perform administrative actions such as promoting/demoting other participants to/from admin status, and removing other participants from the chat.

Since
R4

◆ isHiddenFlagSet

- (BOOL) isHiddenFlagSet
readnonatomicassign

The chat has been hidden (by 'stopConversation'). The chat will automatically stop being hidden when:the next incoming or outgoing 'chatMessage' is added, or(iff this is a 1:1 chat) when a 'chatStart' request identifying this chat is received.

Since
R2

◆ isMissingChatKeyFlagSet

- (BOOL) isMissingChatKeyFlagSet
readnonatomicassign

The chat has at least one message that chat keys are missing for.

Since
R13

◆ isOneToOneFlagSet

- (BOOL) isOneToOneFlagSet
readnonatomicassign

The chat is the singular 1:1 chat between the local user and the other party. bbmcore ensures that only one such non-Defunct chat per remote party will exist at a time. Otherwise, the chat is a multi-party chat, even if there are fewer than two remote parties.

Since
R4

◆ keyState

- (BBMChatKeyState) keyState
readnonatomicassign

The current state of the chat's key. New chats that are created with a key start in the 'Export' state. New chats that are created without a key start in the 'Import' state.

Since
R3

◆ lastActivity

- (unsigned long long) lastActivity
readnonatomicassign

This holds the timestamp, in seconds since 1970, of the most recent notable activity in the chat. Notable activity includes:When a 'chat' is created, 'lastActivity' is set to the timestamp associated with the event that created the chat.When a new 'chatMessage' is added to this chat and that message does not have the 'neverCountUnread' flag set, 'lastActivity' is set to the 'timestamp' of that message.Note that the 'lastActivity' does not always increase. Messages can arrive with lower timestamps than previous messages or the current 'lastActivity' and their timestamps will be applied to this field.

Since
R2

◆ lastMessage

- (unsigned long long) lastMessage
readnonatomicassign

The identifier of the most recent message added to the history. When combined with the chatId, this is a foreign key into 'listChatMessage'. bbmcore notifies your application of new messages by incrementing this value.

Since
R2

◆ localData

- (NSDictionary*) localData
readnonatomicstrong

This field contains opaque local-only data that is associated with this chat and managed by your application. This data is stored locally on this endpoint only.

Since
R2

◆ mailboxId

- (NSString*) mailboxId
readnonatomicstrong

The identifier used externally to uniquely identify this chat. Empty when not known.

Since
R3

◆ numMessages

- (unsigned long long) numMessages
readnonatomicassign

The total number of messages in the chat. When this value decreases, messages have been removed from the 'old' end of the message list. When this value increases, messages have been added to the 'new' end of the message list. bbmcore will increment this attribute whenever a new message arrives.

Since
R2

◆ numUnread

- (unsigned long long) numUnread
readnonatomicassign

The number of incoming messages in the chat that the local user has yet to mark as Read. This count does not include messages that have 'neverCountUnread' flag set.

Since
R5

◆ privateData

- (NSDictionary*) privateData
readnonatomicstrong

This field contains opaque data managed by your application.This data can be read or written only by endpoints belonging to the local user's identity. Concurrent writes are resolved in a way that all endpoints will eventually see the same steady-state outcome.This field is suitable for chat metadata that changes infrequently and is private to the local user's identity but needs to be known by all the local user's endpoints.The 'privateData', encoded as JSON in UTF-8, must not exceed 71680 bytes (70 KB).

Since
R7

◆ restorePoint

- (unsigned long long) restorePoint
readnonatomicassign

The identifier of the most recent message restored from the BlackBerry Infrastructure when the chat was joined or restored. Messages after this point are considered to have arrived while this endpoint was actively receiving content from the chat. This value is not updated when the message it identifies is no longer part of the chat. If no messages existed in the chat when it was created, joined, or restored, or if for some reason the restore point is unknown, then this will be zero.

Since
R2

◆ state

- (BBMChatState) state
readnonatomicassign

The state of the chat.

Since
R2

◆ subject

- (NSString*) subject
readnonatomicstrong

Holds the user-readable subject of the chat. This field has a maximum size of 128 code points.

Since
R2