AgoraChatSDK 1.2.0
Instance Methods | Properties | List of all members
AgoraChatImageMessageBody Class Reference

#import <AgoraChatImageMessageBody.h>

Inheritance diagram for AgoraChatImageMessageBody:
AgoraChatFileMessageBody AgoraChatMessageBody

Instance Methods

(instancetype) - initWithData:thumbnailData:
- Instance Methods inherited from AgoraChatFileMessageBody
(instancetype _Nonnull) - initWithLocalPath:displayName:
(instancetype _Nonnull) - initWithData:displayName:


CGSize size
CGFloat compressionRatio
NSString * thumbnailDisplayName
NSString * thumbnailLocalPath
NSString * thumbnailRemotePath
NSString * thumbnailSecretKey
CGSize thumbnailSize
long long thumbnailFileLength
AgoraChatDownloadStatus thumbnailDownloadStatus
- Properties inherited from AgoraChatFileMessageBody
NSString * displayName
NSString * localPath
NSString * remotePath
NSString * secretKey
long long fileLength
AgoraChatDownloadStatus downloadStatus
- Properties inherited from AgoraChatMessageBody
AgoraChatMessageBodyType type
NSUInteger operationTime
NSString * operatorId
NSUInteger operatorCount

Detailed Description

@header AgoraChatImageMessageBody.h @abstract Image message body class

3.00 The image message body.

You can create an image message body by calling one of the following methods:

-(instancetype)initWithData:displayName: -(instancetype)initWithData:thumbnailData:

Note: SDK will compress the image based on the attribute compressRatio when delivering the image.

Method Documentation

◆ initWithData:thumbnailData:

- (instancetype) initWithData: (NSData *)  aData
thumbnailData: (NSData *)  aThumbnailData 

Initializes an image message body instance.

The image receiver will receive object thumbnail that generated based on sender's aData object.

Adjusts thumbnail resolution on Hyphenate console -> "Thumbnail Size" -> width and height. Unit in px. ex. aData resolution 200 x 400 (1:2), thumbnail resolution setting (width x height) 200 x 200, then will generate thumbnail in 100 x 200 ex. aData resolution 600 x 300 (2:1), thumbnail resolution setting (width x height) 200 x 200, then will generate thumbnail in 200 x 100

The image sender can obtain thumbnail from thumbnailLocalPath.

The image receiver will get thumbnail stored under thumbnailRemotePath after a successful download automatically. However, if the automatic downloading failed, use the following method, downloadMessageThumbnail:progress:completion:

aDataThe original image object in NSData format.
aThumbnailDataThe thumbnail in NSData format. Will not push to server, but only for local usage.
An image message body instance.

Property Documentation

◆ compressionRatio

- (CGFloat) compressionRatio

The compression ratio of the image file.

When sending the image message, the SDK compresses the image file according to the value of this parameter. The value range is (0.0, 1.0], and the default value is 0.6. 1.0 means that the SDK does not compress the image file, and 0.6 means that the SDK compresses the file size to 60% of the original. If you set this parameter to a value lower than 0 (included), the SDK uses the default value.

◆ size

- (CGSize) size

The resolution of the image.

◆ thumbnailDisplayName

- (NSString*) thumbnailDisplayName

The display name of thumbnail.

◆ thumbnailDownloadStatus

- (AgoraChatDownloadStatus) thumbnailDownloadStatus

The download status of the thumbnail.

◆ thumbnailFileLength

- (long long) thumbnailFileLength

The data length (bytes) of the thumbnail file.

◆ thumbnailLocalPath

- (NSString*) thumbnailLocalPath

The local path of the thumbnail. UIImage *image = [UIImage imageWithContentsOfFile:thumbnailLocalPath];

◆ thumbnailRemotePath

- (NSString*) thumbnailRemotePath

The URL path of the thumbnail of the server.

The message receiver gets the thumbnail with this member.

◆ thumbnailSecretKey

- (NSString*) thumbnailSecretKey

The secret key for the thumbnail. A key is required for verification when downloading thumbnail.

◆ thumbnailSize

- (CGSize) thumbnailSize

The resolution of the thumbnail file.

The documentation for this class was generated from the following file: