|
7 | 7 | //
|
8 | 8 |
|
9 | 9 | #import <Foundation/Foundation.h>
|
| 10 | +#import <CoreGraphics/CoreGraphics.h> |
| 11 | + |
10 | 12 | #import "SBDUser.h"
|
11 | 13 | #import "SBDUserMessage.h"
|
12 | 14 | #import "SBDAdminMessage.h"
|
13 | 15 | #import "SBDFileMessage.h"
|
14 | 16 | #import "SBDError.h"
|
15 | 17 |
|
16 | 18 | @class SBDPreviousMessageListQuery;
|
| 19 | +@class SBDThumbnail; |
17 | 20 | @class SBDFileMessage;
|
18 | 21 | @class SBDUserMessage;
|
19 | 22 | @class SBDMessageListQuery;
|
|
288 | 291 | *
|
289 | 292 | * @param file File <span>data</span>.
|
290 | 293 | * @param filename File<span>name</span>.
|
291 |
| - * @param type The type of file. |
| 294 | + * @param type The mime type of file. |
292 | 295 | * @param size File size.
|
293 | 296 | * @param data Custom <span>data</span>.
|
294 | 297 | * @param completionHandler The handler block to execute. `fileMessage` is a user message which is returned from the SendBird server. The message has a message ID and an URL.
|
|
302 | 305 | *
|
303 | 306 | * @param file File <span>data</span>.
|
304 | 307 | * @param filename File<span>name</span>.
|
305 |
| - * @param type The type of file. |
| 308 | + * @param type The mime type of file. |
306 | 309 | * @param size File size.
|
307 | 310 | * @param data Custom <span>data</span>.
|
308 | 311 | * @param customType Custom message type.
|
|
344 | 347 | *
|
345 | 348 | * @param file File <span>data</span>.
|
346 | 349 | * @param filename File<span>name</span>.
|
347 |
| - * @param type The type of file. |
| 350 | + * @param type The mime type of file. |
348 | 351 | * @param size File size.
|
349 | 352 | * @param data Custom <span>data</span>.
|
350 | 353 | * @param progressHandler The handler block to monitor progression. `bytesSent` is the number of bytes sent since the last time this method was called. `totalBytesSent` is the total number of bytes sent so far. `totalBytesExpectedToSend` is the expected length of the body <span>data</span>. These parameters are the same to the declaration of [`URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`](https://developer.apple.com/reference/foundation/nsurlsessiontaskdelegate/1408299-urlsession?language=objc).
|
|
359 | 362 | *
|
360 | 363 | * @param file File <span>data</span>.
|
361 | 364 | * @param filename File<span>name</span>.
|
362 |
| - * @param type The type of file. |
| 365 | + * @param type The mime type of file. |
363 | 366 | * @param size File size.
|
364 | 367 | * @param data Custom <span>data</span>.
|
365 | 368 | * @param customType Custom message type.
|
|
370 | 373 | */
|
371 | 374 | - (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData * _Nonnull)file filename:(NSString * _Nonnull)filename type:(NSString * _Nonnull)type size:(NSUInteger)size data:(NSString * _Nullable)data customType:(NSString * _Nullable)customType progressHandler:(nullable void (^)(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))progressHandler completionHandler:(nullable void (^)(SBDFileMessage * _Nullable fileMessage, SBDError * _Nullable error))completionHandler;
|
372 | 375 |
|
| 376 | +/** |
| 377 | + * Sends a file message with binary <span>data</span>. The binary <span>data</span> is uploaded to SendBird file storage and a URL of the file will be generated. The uploading progress callback can be implemented. |
| 378 | + * |
| 379 | + * @param file File <span>data</span>. |
| 380 | + * @param filename File<span>name</span>. |
| 381 | + * @param type The mime type of file. |
| 382 | + * @param size File size. |
| 383 | + * @param thumbnailSizes Thumbnail sizes. This parameter works for image file only. |
| 384 | + * @param data Custom <span>data</span>. |
| 385 | + * @param customType Custom message type. |
| 386 | + * @param progressHandler The handler block to monitor progression. `bytesSent` is the number of bytes sent since the last time this method was called. `totalBytesSent` is the total number of bytes sent so far. `totalBytesExpectedToSend` is the expected length of the body <span>data</span>. These parameters are the same to the declaration of [`URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`](https://developer.apple.com/reference/foundation/nsurlsessiontaskdelegate/1408299-urlsession?language=objc). |
| 387 | + * @param completionHandler The handler block to execute. `fileMessage` is a user message which is returned from the SendBird server. The message has a message ID and an URL. |
| 388 | + * |
| 389 | + * @return Returns the temporary file message with a request ID. It doesn't have a message ID and an URL. |
| 390 | + */ |
| 391 | +- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData * _Nonnull)file filename:(NSString * _Nonnull)filename type:(NSString * _Nonnull)type size:(NSUInteger)size thumbnailSizes:(NSArray<SBDThumbnail *> * _Nullable)thumbnailSizes data:(NSString * _Nullable)data customType:(NSString * _Nullable)customType progressHandler:(nullable void (^)(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))progressHandler completionHandler:(nullable void (^)(SBDFileMessage * _Nullable fileMessage, SBDError * _Nullable error))completionHandler; |
| 392 | + |
373 | 393 | #pragma mark - Load message list
|
374 | 394 | /**
|
375 | 395 | * Creates `SBDPreviousMessageListQuery` instance for getting the previous messages list of the channel.
|
|
0 commit comments