EkoMediaRepository
@interface EkoMediaRepository : NSObject
Provides access to the media associated with messages
-
Downloads the image for the given messageId. This method resumes (or starts) the download for the image.
Declaration
Objective-C
- (void)getImageForMessageId:(nonnull NSString *)messageId size:(EkoMediaSize)size resultHandler: (void (^_Nonnull)(UIImage *_Nullable, EkoMediaSize, NSError *_Nullable))resultHandler;
Swift
func getImageForMessageId(_ messageId: String, size: EkoMediaSize, resultHandler: @escaping (UIImage?, EkoMediaSize, Error?) -> Void)
Parameters
messageId
A message Identifier
size
of the media to donwload (defaults to medium if nil)
resultHandler
the block to be called with the requested image (or eventual error)
-
Downloads the file for the given messageId. This method resumes (or starts) the download for the file.
Declaration
Objective-C
- (void)getFileForMessageId:(nonnull NSString *)messageId resultHandler:(void (^_Nonnull)(NSData *_Nullable, NSError *_Nullable))resultHandler;
Swift
func getFileForMessageId(_ messageId: String, resultHandler: @escaping (Data?, Error?) -> Void)
Parameters
messageId
A message Identifier
resultHandler
the block to be called with the requested file (or eventual error)
-
Stops (pauses) the media download for the given messageId and EkoMediaSize
Declaration
Objective-C
- (void)cancelGetMediaForMessageId:(nonnull NSString *)messageId size:(EkoMediaSize)size;
Swift
func cancelGetMedia(forMessageId messageId: String, size: EkoMediaSize)
Parameters
messageId
A message Identifier
size
A proper EkoMediaSize
-
Unavailable
Block call of
init
andnew
because this object cannot be created directlyDeclaration
Objective-C
- (nonnull instancetype)init;