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
messageIdA message Identifier
sizeof the media to donwload (defaults to medium if nil)
resultHandlerthe 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
messageIdA message Identifier
resultHandlerthe 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
messageIdA message Identifier
sizeA proper EkoMediaSize
-
Unavailable
Block call of
initandnewbecause this object cannot be created directlyDeclaration
Objective-C
- (nonnull instancetype)init;
EkoMediaRepository Class Reference