Skip to content

Commit

Permalink
* Added the class to represent a thumbnail max size.
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-jed-kyung committed Jan 4, 2017
1 parent cde4f28 commit 05ffd35
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

### v3.0.27(Jan 4, 2017)
* Added the class to represent a thumbnail max size.

### v3.0.26(Jan 3, 2017)
* Fixed the bug of the group channel's data.
* Added the feature for generating the thumbnail of the image file message.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Platform](https://img.shields.io/badge/platform-iOS-orange.svg)](https://cocoapods.org/pods/SendBirdSDK)
[![Languages](https://img.shields.io/badge/language-Objective--C%20%7C%20Swift-orange.svg)](https://github.com/smilefam/sendbird-ios-framework)
[![CocoaPods](https://img.shields.io/badge/pod-v3.0.26-green.svg)](https://cocoapods.org/pods/SendBirdSDK)
[![CocoaPods](https://img.shields.io/badge/pod-v3.0.27-green.svg)](https://cocoapods.org/pods/SendBirdSDK)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Commercial License](https://img.shields.io/badge/license-Commercial-brightgreen.svg)](https://github.com/smilefam/sendbird-ios-framework/blob/master/LICENSE.md)

Expand Down
5 changes: 3 additions & 2 deletions SendBirdSDK.framework/Headers/SBDBaseChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "SBDError.h"

@class SBDPreviousMessageListQuery;
@class SBDThumbnailSize;
@class SBDThumbnail;
@class SBDFileMessage;
@class SBDUserMessage;
Expand Down Expand Up @@ -380,15 +381,15 @@
* @param filename File<span>name</span>.
* @param type The mime type of file.
* @param size File size.
* @param thumbnailSizes Thumbnail sizes. This parameter works for image file only.
* @param thumbnailSizes Thumbnail sizes. This parameter is the array of `SBDThumbnailSize` object and works for image file only.
* @param data Custom <span>data</span>.
* @param customType Custom message type.
* @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).
* @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.
*
* @return Returns the temporary file message with a request ID. It doesn't have a message ID and an URL.
*/
- (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;
- (nonnull SBDFileMessage *)sendFileMessageWithBinaryData:(NSData * _Nonnull)file filename:(NSString * _Nonnull)filename type:(NSString * _Nonnull)type size:(NSUInteger)size thumbnailSizes:(NSArray<SBDThumbnailSize *> * _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;

#pragma mark - Load message list
/**
Expand Down
43 changes: 24 additions & 19 deletions SendBirdSDK.framework/Headers/SBDFileMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,49 @@
#import "SBDBaseMessage.h"
#import "SBDBaseChannel.h"

@interface SBDThumbnailSize : NSObject

/**
The `SBDThumbnail` class represents the thumbnail in the file message.
The max size of the thumbnail.
*/
@interface SBDThumbnail : NSObject

@property (nonatomic, readonly) CGSize maxSize;

/**
The url of the thumbnail.
Makes `SBDThumbnailSize` object with `CGSize`.
@param size The max size of the thumbnail.
@return `SBDThumbnailSize` object.
*/
@property (strong, nonatomic, readonly, nonnull) NSString *url;
+ (nullable instancetype)makeWithMaxCGSize:(CGSize)size;


/**
The maximum size of the thumbnail.
Makes `SBDThumbnailSize` object with width and height.
@param width The max width of the thumbnail.
@param height The max height of the thumbnail.
@return `SBDThumbnailSize` object.
*/
@property (nonatomic, readonly) CGSize maxSize;
+ (nullable instancetype)makeWithMaxWidth:(CGFloat)width maxHeight:(CGFloat)height;

@end


/**
Initializes the object for sending file message.
The `SBDThumbnail` class represents the thumbnail in the file message.
*/
@interface SBDThumbnail : NSObject

@param maxWidth The maximum width of the thumbnail.
@param maxHeight the maximum height of the thumbnail.
@return The `SBDThumbnail` object.
/**
The url of the thumbnail.
*/
- (nullable instancetype)initWithMaxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight;
@property (strong, nonatomic, readonly, nonnull) NSString *url;


/**
Initializes the object for the file message which is received.
@param width The width of the thumbnail.
@param height The height of the thumbnail.
@param url The url of the thumbnail.
@return The `SBDThumbnail` object.
The maximum size of the thumbnail.
*/
- (nullable instancetype)initWithWidth:(CGFloat)width height:(CGFloat)height url:(NSString * _Nonnull)url;
@property (nonatomic, readonly) CGSize maxSize;

@end

Expand Down
Binary file modified SendBirdSDK.framework/SendBirdSDK
Binary file not shown.
2 changes: 1 addition & 1 deletion SendBirdSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SendBirdSDK"
s.version = "3.0.26"
s.version = "3.0.27"
s.summary = "SendBird iOS Framework"
s.description = "Messaging and Chat API for Mobile Apps and Websites"
s.homepage = "https://sendbird.com"
Expand Down

0 comments on commit 05ffd35

Please sign in to comment.