NIMMessage Class Reference
| Inherits from | NSObject | 
|---|---|
| Declared in | NIMMessage.h | 
  messageType
	消息类型
@property (nonatomic, assign, readonly) NIMMessageType messageTypeDiscussion
消息类型
Declared In
NIMMessage.h
  messageSubType
	消息子类型.(默认0。设置值需要大于0)
@property (nonatomic, assign) NSInteger messageSubTypeDiscussion
消息子类型.(默认0。设置值需要大于0)
Declared In
NIMMessage.h
  from
	消息来源
@property (nullable, nonatomic, copy) NSString *fromDiscussion
消息来源
Declared In
NIMMessage.h
  session
	消息所属会话
@property (nullable, nonatomic, copy, readonly) NIMSession *sessionDiscussion
消息所属会话
Declared In
NIMMessage.h
  messageId
	消息ID,唯一标识
@property (nonatomic, copy, readonly) NSString *messageIdDiscussion
消息ID,唯一标识
Declared In
NIMMessage.h
  serverID
	消息服务端ID
@property (nonatomic, copy, readonly) NSString *serverIDDiscussion
消息服务端ID
Declared In
NIMMessage.h
  text
	消息文本
@property (nullable, nonatomic, copy) NSString *textDiscussion
消息文本
消息中除 NIMMessageTypeText 和 NIMMessageTypeTip 外,其他消息 text 字段都为 nil
Declared In
NIMMessage.h
  messageObject
	消息附件内容
@property (nullable, nonatomic, strong) id<NIMMessageObject> messageObjectDiscussion
消息附件内容
Declared In
NIMMessage.h
  setting
	消息设置
@property (nullable, nonatomic, strong) NIMMessageSetting *settingDiscussion
消息设置
可以通过这个字段制定当前消息的各种设置,如是否需要计入未读,是否需要多端同步等
Declared In
NIMMessage.h
  antiSpamOption
	消息反垃圾配置
@property (nullable, nonatomic, strong) NIMAntiSpamOption *antiSpamOptionDiscussion
消息反垃圾配置
Declared In
NIMMessage.h
  apnsContent
	消息推送文案,长度限制500字,撤回消息时该字段无效
@property (nullable, nonatomic, copy) NSString *apnsContentDiscussion
消息推送文案,长度限制500字,撤回消息时该字段无效
Declared In
NIMMessage.h
  apnsPayload
	消息推送Payload
@property (nullable, nonatomic, copy) NSDictionary *apnsPayloadDiscussion
消息推送Payload
可以通过这个字段定义消息推送 Payload ,支持字段参考苹果技术文档,长度限制 2K,撤回消息时该字段无效
Declared In
NIMMessage.h
  apnsMemberOption
	指定成员推送选项
@property (nullable, nonatomic, strong) NIMMessageApnsMemberOption *apnsMemberOptionDiscussion
指定成员推送选项
通过这个选项进行一些更复杂的推送设定,目前只能在群会话中使用
Declared In
NIMMessage.h
  remoteExt
	服务器扩展
@property (nullable, nonatomic, copy) NSDictionary *remoteExtDiscussion
服务器扩展
客户端可以设置这个字段,这个字段将在本地存储且发送至对端,上层需要保证 NSDictionary 可以转换为 JSON,长度限制 1K
Declared In
NIMMessage.h
  localExt
	客户端本地扩展
@property (nullable, nonatomic, copy) NSDictionary *localExtDiscussion
客户端本地扩展
客户端可以设置这个字段,这个字段只在本地存储,不会发送至对端,上层需要保证 NSDictionary 可以转换为 JSON
Declared In
NIMMessage.h
  timestamp
	消息发送时间
@property (nonatomic, assign) NSTimeInterval timestampDiscussion
消息发送时间
本地存储消息可以通过修改时间戳来调整其在会话列表中的位置,发完服务器的消息时间戳将被服务器自动修正
Declared In
NIMMessage.h
  yidunAntiCheating
	易盾反垃圾增强反作弊专属字段
@property (nullable, nonatomic, copy) NSDictionary *yidunAntiCheatingDiscussion
易盾反垃圾增强反作弊专属字段
透传易盾反垃圾增强反作弊专属字段
Declared In
NIMMessage.h
  yidunAntiSpamExt
	易盾反垃圾扩展字段,限制json,长度限制1024
@property (nullable, nonatomic, copy) NSString *yidunAntiSpamExtDiscussion
易盾反垃圾扩展字段,限制json,长度限制1024
Declared In
NIMMessage.h
  yidunAntiSpamRes
	易盾反垃圾返回的结果字段
@property (nullable, nonatomic, copy) NSString *yidunAntiSpamResDiscussion
易盾反垃圾返回的结果字段
Declared In
NIMMessage.h
  locationX
	X坐标,仅用于聊天室
@property (nonatomic, copy) NSNumber *locationXDiscussion
X坐标,仅用于聊天室
Declared In
NIMMessage.h
  locationY
	Y坐标,仅用于聊天室
@property (nonatomic, copy) NSNumber *locationYDiscussion
Y坐标,仅用于聊天室
Declared In
NIMMessage.h
  locationZ
	Z坐标。仅用于聊天室
@property (nonatomic, copy) NSNumber *locationZDiscussion
Z坐标。仅用于聊天室
Declared In
NIMMessage.h
  toAccIds
	消息接受者列表,仅用于聊天室
@property (nonatomic, copy) NSArray<NSString*> *toAccIdsDiscussion
消息接受者列表,仅用于聊天室
Declared In
NIMMessage.h
  notifyTargetTags
	消息的目标标签表达式
@property (nullable, nonatomic, copy) NSString *notifyTargetTagsDiscussion
消息的目标标签表达式
Declared In
NIMMessage.h
  env
	环境变量
@property (nullable, nonatomic, copy) NSString *envDiscussion
环境变量
环境变量,用于指向不同的抄送、第三方回调等配置
Declared In
NIMMessage.h
  deliveryState
	消息投递状态 仅针对发送的消息
@property (nonatomic, assign, readonly) NIMMessageDeliveryState deliveryStateDiscussion
消息投递状态 仅针对发送的消息
Declared In
NIMMessage.h
  attachmentDownloadState
	消息附件下载状态 仅针对收到的消息
@property (nonatomic, assign, readonly) NIMMessageAttachmentDownloadState attachmentDownloadStateDiscussion
消息附件下载状态 仅针对收到的消息
Declared In
NIMMessage.h
  isReceivedMsg
	是否是收到的消息
@property (nonatomic, assign, readonly) BOOL isReceivedMsgDiscussion
是否是收到的消息
由于有漫游消息的概念,所以自己发出的消息漫游下来后仍旧是"收到的消息",这个字段用于消息出错是时判断需要重发还是重收
Declared In
NIMMessage.h
  isOutgoingMsg
	是否是往外发的消息
@property (nonatomic, assign, readonly) BOOL isOutgoingMsgDiscussion
是否是往外发的消息
由于能对自己发消息,所以并不是所有来源是自己的消息都是往外发的消息,这个字段用于判断头像排版位置(是左还是右)。
Declared In
NIMMessage.h
  isPlayed
	消息是否被播放过
@property (nonatomic, assign) BOOL isPlayedDiscussion
消息是否被播放过
修改这个属性,后台会自动更新 db 中对应的数据。聊天室消息里,此字段无效。
Declared In
NIMMessage.h
  isDeleted
	消息是否标记为已删除
@property (nonatomic, assign, readonly) BOOL isDeletedDeclared In
NIMMessage.h
  isRemoteRead
	对端是否已读
@property (nonatomic, assign, readonly) BOOL isRemoteReadDeclared In
NIMMessage.h
  isTeamReceiptSended
	是否已发送群回执
@property (nonatomic, assign, readonly) BOOL isTeamReceiptSendedDiscussion
是否已发送群回执
只针对群消息有效
Declared In
NIMMessage.h
  teamReceiptInfo
	群已读回执信息
@property (nullable, nonatomic, strong, readonly) NIMTeamMessageReceipt *teamReceiptInfoDiscussion
群已读回执信息
只有当当前消息为 Team 消息且 teamReceiptEnabled 为 YES 时才有效,需要对端调用过发送已读回执的接口
Declared In
NIMMessage.h
  senderName
	消息发送者名字
@property (nullable, nonatomic, copy, readonly) NSString *senderNameDiscussion
消息发送者名字
当发送者是自己时,这个值可能为空,这个值表示的是发送者当前的昵称,而不是发送消息时的昵称。聊天室消息里,此字段无效。
Declared In
NIMMessage.h
  senderClientType
	发送者客户端类型
@property (nonatomic, assign, readonly) NIMLoginClientType senderClientTypeDiscussion
发送者客户端类型
Declared In
NIMMessage.h
  isBlackListed
	是否在黑名单中
@property (nonatomic, assign, readonly) BOOL isBlackListedDiscussion
是否在黑名单中
YES 为被目标拉黑;
Declared In
NIMMessage.h
  repliedMessageId
	该消息回复的目标消息的消息ID
@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageIdDiscussion
该消息回复的目标消息的消息ID
如果未回复其他消息,则为空
A为一条普通消息,B消息为对A回复的消息,则A是B的 replied 消息和 thread 消息; 同时, C为回复B的消息,则C的 replied 消息是B, C的thread消息为A
Declared In
NIMMessage.h
  repliedMessageServerId
	该消息回复的目标消息的服务端ID
@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageServerIdDiscussion
该消息回复的目标消息的服务端ID
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  repliedMessageFrom
	该消息回复的目标消息的发送者
@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageFromDiscussion
该消息回复的目标消息的发送者
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  repliedMessageTo
	该消息回复的目标消息的接收者
@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageToDiscussion
该消息回复的目标消息的接收者
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  repliedMessageTime
	该消息回复的目标消息的发送时间
@property (nonatomic, assign, readonly) NSTimeInterval repliedMessageTimeDiscussion
该消息回复的目标消息的发送时间
如果未回复其他消息则为0(单位:秒)
Declared In
NIMMessage.h
  threadMessageId
	该消息的父消息的消息ID
@property (nullable, nonatomic, copy, readonly) NSString *threadMessageIdDiscussion
该消息的父消息的消息ID
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  threadMessageServerId
	该消息的父消息的服务端ID
@property (nullable, nonatomic, copy, readonly) NSString *threadMessageServerIdDiscussion
该消息的父消息的服务端ID
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  threadMessageFrom
	该消息回复的父消息的发送者
@property (nullable, nonatomic, copy, readonly) NSString *threadMessageFromDiscussion
该消息回复的父消息的发送者
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  threadMessageTo
	该消息回复的目标消息的接收者
@property (nullable, nonatomic, copy, readonly) NSString *threadMessageToDiscussion
该消息回复的目标消息的接收者
如果未回复其他消息,则为空
Declared In
NIMMessage.h
  threadMessageTime
	该消息回复的父消息的发送时间
@property (nonatomic, assign, readonly) NSTimeInterval threadMessageTimeDiscussion
该消息回复的父消息的发送时间
如果未回复其他消息则为0(单位:秒)
Declared In
NIMMessage.h
  callbackExt
	第三方回调回来的自定义扩展字段
@property (nonatomic, copy, readonly) NSString *callbackExtDiscussion
第三方回调回来的自定义扩展字段
Declared In
NIMMessage.h
  status
	消息处理状态
@property (nonatomic, assign) NIMMessageStatus statusDiscussion
消息处理状态
Declared In
NIMMessage.h