agora_chat_SDK  3.8.2
Instance Methods | Properties | List of all members
ImageMessageBody Class Reference

#import <ImageMessageBody.h>

Inheritance diagram for ImageMessageBody:
FileMessageBody MessageBody

Instance Methods

(instancetype) - initWithData:thumbnailData:
 
(CGFloat compressRatio) - __deprecated_msg
 
- Instance Methods inherited from FileMessageBody
(instancetype) - initWithLocalPath:displayName:
 
(instancetype) - initWithData:displayName:
 

Properties

CGSize size
 
CGFloat compressionRatio
 
NSString * thumbnailDisplayName
 
NSString * thumbnailLocalPath
 
NSString * thumbnailRemotePath
 
NSString * thumbnailSecretKey
 
CGSize thumbnailSize
 
long long thumbnailFileLength
 
AgoraDownloadStatus thumbnailDownloadStatus
 
- Properties inherited from FileMessageBody
NSString * displayName
 
NSString * localPath
 
NSString * remotePath
 
NSString * secretKey
 
long long fileLength
 
AgoraDownloadStatus downloadStatus
 
- Properties inherited from MessageBody
MessageBodyType type
 

Detailed Description

ImageMessageBody.h Image message body class

Author
Hyphenate
Version
3.00

Image message body -(instancetype)initWithData:displayName: or -(instancetype)initWithData:thumbnailData: Note: SDK will compress the image based on the attribute compressRatio when delivering the image

Method Documentation

- (CGFloat compressRatio) __deprecated_msg ("Use - compressionRatio instead") 

Image compression ratio. 1.0 without compression, default value is 0.6. SDK uses the default value if the given value is less than zero.

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

Initialize an image message body instance

Image receiver will receive object thumbnail that generated based on sender's aData object. Adjust thumbnail resolution on Hyphenate conosle -> "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

Image sender can obtain thumbnail from thumbnailLocalPath 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
aDataoriginal image object in NSData format
aThumbnailDataThumbnail in NSData format. Will not push to server, but only for local usage
Returns
An image message body instance

Property Documentation

- (CGFloat) compressionRatio
readwritenonatomicassign

SDK will compress the image based on the attribute compressRatio when delivering the image Image compression ratio. 1.0x is original image without compression , default value is 0.6x (60% compression). SDK uses the default value if the given value is less than zero.

- (CGSize) size
readwritenonatomicassign

Resolution of the image

- (NSString*) thumbnailDisplayName
readwritenonatomiccopy

Display name of thumbnail

- (AgoraDownloadStatus) thumbnailDownloadStatus
readwritenonatomicassign

Download status of a thumbnail

- (long long) thumbnailFileLength
readwritenonatomicassign

File size of a thumbnail, in bytes

- (NSString*) thumbnailLocalPath
readwritenonatomiccopy

Local path of thumbnail UIImage *image = [UIImage imageWithContentsOfFile:thumbnailLocalPath];

- (NSString*) thumbnailRemotePath
readwritenonatomiccopy

Server url path of thumbnail

- (NSString*) thumbnailSecretKey
readwritenonatomiccopy

Secret key for thumbnail image, a key is required for verification when downloading thumbnail

- (CGSize) thumbnailSize
readwritenonatomicassign

Resolution of the thumbnail


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