MLIMMessage Class Reference

Inherits from MLIMRuntimeObject : NSObject
Conforms to NSCopying
NSSecureCoding
Declared in MLIMMessage.h

Overview

The representation of a message.

Properties

  status

Message status @see MLIMMessageStatus

@property (nonatomic, readonly) MLIMMessageStatus status

Declared In

MLIMMessage.h

  sendTimestamp

The message send timestamp. Seconds since 1970.

@property (nonatomic) NSTimeInterval sendTimestamp

Declared In

MLIMMessage.h

  sender

The message sender.

@property (nonatomic, strong) MLIMMessageTarget *sender

Declared In

MLIMMessage.h

  receiver

The message receiver.

@property (nonatomic, strong) MLIMMessageTarget *receiver

Declared In

MLIMMessage.h

– isSystemMessage

Check whether a message is from system.

- (BOOL)isSystemMessage

Return Value

YES if from system, NO otherwise.

Declared In

MLIMMessage.h

  mediaType

The media type of the message.

@property (nonatomic) MLIMMediaType mediaType

Declared In

MLIMMessage.h

  text

Text of text message, nil if mediaType != MLIMMediaTypeText.

@property (nonatomic, copy, nullable) NSString *text

Discussion

@disscussion MaxLeap recommends that you use the remark property to define custom message structure.

Declared In

MLIMMessage.h

  pushEnable

If NO, this message will not trigger a remote push notification.

@property (nonatomic) BOOL pushEnable

Declared In

MLIMMessage.h

  pushSound

The name of a sound file in the app bundle or in the Library/Sounds folder of the app’s data container. See https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html for details.

@property (nonatomic, strong) NSString *pushSound

Declared In

MLIMMessage.h

  pushPrefix

The prefix for push notification.

@property (nonatomic, copy, nullable) NSString *pushPrefix

Declared In

MLIMMessage.h

  pushSuffix

The suffix for push notification.

@property (nonatomic, copy, nullable) NSString *pushSuffix

Declared In

MLIMMessage.h

  pushBodyOverwrite

The message body for push notification. If the value of this property doesn’t exist, message.text will be used.

@property (nonatomic, copy, nullable) NSString *pushBodyOverwrite

Discussion

The final push alert body is: pushPrefix + (pushBodyOverwrite || message.text) + pushSuffix.

Declared In

MLIMMessage.h

  pushContentAvailable

@property (nonatomic) BOOL pushContentAvailable

Declared In

MLIMMessage.h

  remark

Some addtional information for the message.

@property (nonatomic, copy, nullable) NSString *remark

Discussion

@disscussion MaxLeap recommends that you use this property to define custom message structure.

Declared In

MLIMMessage.h

  attachmentUrl

The attachment url of nontext message.

@property (nonatomic, copy, nullable) NSString *attachmentUrl

Declared In

MLIMMessage.h

  thumbnailUrl

Nil if the attachement is not an image, size: 240*240

@property (nonatomic, copy, nullable) NSString *thumbnailUrl

Declared In

MLIMMessage.h

Creates a new message.

– initWithPayloadDictionary:

Creates a message object from message payload.

- (instancetype)initWithPayloadDictionary:(NSDictionary *)dictionary

Parameters

dictionary

The message payload dictionary.

Return Value

A new message object.

Declared In

MLIMMessage.h

+ messageWithText:

Creates a new text message with the text.

+ (instancetype)messageWithText:(NSString *)text

Parameters

text

The content of text message.

Return Value

A new text message object. Will throw an exception if text is nil.

Declared In

MLIMMessage.h

+ messageWithImage:

Creates a new image message with an image.

+ (nullable instancetype)messageWithImage:(UIImage *)image

Parameters

image

The content of image message.

Return Value

A new image message object.

Declared In

MLIMMessage.h

+ messageWithImageFileAtPath:

Creates a new image message with the path to the image file.

+ (nullable instancetype)messageWithImageFileAtPath:(NSString *)imagePath

Parameters

imagePath

The path to the image file.

Return Value

A new image message object.

Declared In

MLIMMessage.h

+ messageWithAudioFileAtPath:

Creates a new audio message with audio file path.

+ (nullable instancetype)messageWithAudioFileAtPath:(NSString *)path

Parameters

path

The audio file path.

Return Value

A new audio message object.

Declared In

MLIMMessage.h

+ messageWithVideoFileAtPath:

Creates a video message with video file path.

+ (nullable instancetype)messageWithVideoFileAtPath:(NSString *)path

Parameters

path

The video file path

Return Value

A new video message object.

Declared In

MLIMMessage.h