AgoraChatSDK 1.3.1
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:
 

Properties

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

Author
Hyphenate
Version
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:

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

Property Documentation

◆ compressionRatio

- (CGFloat) compressionRatio
readwritenonatomicassign

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
readwritenonatomicassign

The resolution of the image.

◆ thumbnailDisplayName

- (NSString*) thumbnailDisplayName
readwritenonatomiccopy

The display name of thumbnail.

◆ thumbnailDownloadStatus

- (AgoraChatDownloadStatus) thumbnailDownloadStatus
readwritenonatomicassign

The download status of the thumbnail.

◆ thumbnailFileLength

- (long long) thumbnailFileLength
readwritenonatomicassign

The data length (bytes) of the thumbnail file.

◆ thumbnailLocalPath

- (NSString*) thumbnailLocalPath
readwritenonatomiccopy

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

◆ thumbnailRemotePath

- (NSString*) thumbnailRemotePath
readwritenonatomiccopy

The URL path of the thumbnail of the server.

The message receiver gets the thumbnail with this member.

◆ thumbnailSecretKey

- (NSString*) thumbnailSecretKey
readwritenonatomiccopy

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

◆ thumbnailSize

- (CGSize) thumbnailSize
readwritenonatomicassign

The resolution of the thumbnail file.


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