Skip to content

Commit 4a49fb5

Browse files
committed
* Added - UIKit version information to User-Agent
* Fixed - Crash issue while scrolling TableView
1 parent b87e995 commit 4a49fb5

38 files changed

+170
-104
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
### v1.0.4 (Apr 29, 2020)
4+
* Added - UIKit version information to User-Agent
5+
* Fixed - Crash issue while scrolling TableView
6+
37
### v1.0.3 (Apr 23, 2020)
48
* Fixed - Framework error issue in macOS Mojave
59

SendBirdUIKit.framework.dSYM/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleSignature</key>
1414
<string>????</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.0.3</string>
16+
<string>1.0.4</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
18.3 KB
Binary file not shown.

SendBirdUIKit.framework/Assets.car

0 Bytes
Binary file not shown.

SendBirdUIKit.framework/Headers/SBUChannelViewController.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ open class SBUChannelViewController: UIViewController, UITableViewDelegate, UITa
405405
var preSendMessage: SBDUserMessage?
406406
guard let messageParam = SBDUserMessageParams(message: text) else { return }
407407

408-
self.scrollToTop()
409-
410408
preSendMessage = self.channel?.sendUserMessage(with: messageParam) { [weak self] userMessage, error in
411409
guard let self = self else { return }
412410
guard error == nil else {
@@ -417,7 +415,7 @@ open class SBUChannelViewController: UIViewController, UITableViewDelegate, UITa
417415
self.didReceiveError(error?.localizedDescription)
418416
return
419417
}
420-
418+
421419
guard let message = userMessage else { return }
422420
guard let requestId = userMessage?.requestId else { return }
423421

@@ -433,6 +431,7 @@ open class SBUChannelViewController: UIViewController, UITableViewDelegate, UITa
433431
self.sortAllMessageList(needReload: true)
434432
self.messageInputView.endTypingMode()
435433
self.channel?.endTyping()
434+
self.scrollToBottom()
436435
}
437436

438437
private func sendFileMessage(fileData: Data, fileName: String, mimeType: String) {
@@ -735,7 +734,7 @@ open class SBUChannelViewController: UIViewController, UITableViewDelegate, UITa
735734
self.newMessageInfoView.isHidden = false
736735
self.newMessagesCount += 1
737736
self.newMessageInfoView.updateTitle(count: self.newMessagesCount) { [weak self] in
738-
self?.scrollToTop()
737+
self?.scrollToBottom()
739738
}
740739
if let indexPath = self.tableView.indexPathsForVisibleRows?[0] {
741740
self.lastSeenIndexPath = IndexPath(row: indexPath.row + 1, section: 0)
@@ -891,7 +890,9 @@ open class SBUChannelViewController: UIViewController, UITableViewDelegate, UITa
891890
self.showChannelSettings()
892891
}
893892

894-
public func scrollToTop() {
893+
public func scrollToBottom() {
894+
guard self.fullMessageList.count != 0 else { return }
895+
895896
DispatchQueue.main.async {
896897
UIView.animate(withDuration: 0.1, animations: {
897898
let indexPath = IndexPath(row: 0, section: 0)

SendBirdUIKit.framework/Headers/SBUConstant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ class SBUConstant {
1818
}
1919

2020
static let coverImagePrefix = "https://static.sendbird.com/sample/cover"
21+
22+
static let sbdExtensionKeyUIKit = "sb_uikit"
2123
}

SendBirdUIKit.framework/Headers/SBUMain.swift

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ public class SBUMain: NSObject {
1515
// MARK: - Initialize
1616
public static func initialize(applicationId: String) {
1717
SBUGlobals.ApplicationId = applicationId
18+
19+
if let version = SBUMain.shortVersionString() {
20+
SBDMain.addExtension(SBUConstant.sbdExtensionKeyUIKit, version: version)
21+
}
22+
1823
SBDMain.initWithApplicationId(applicationId)
1924
}
2025

@@ -78,10 +83,29 @@ public class SBUMain: NSObject {
7883

7984

8085
// MARK: - Common
86+
@available(*, deprecated, renamed: "shortVersionString()")
8187
public static func getUIKitVersion() -> String {
82-
return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
88+
return SBUMain.shortVersionString() ?? ""
8389
}
8490

91+
public static func versionString() -> String? {
92+
let bundle = Bundle(identifier: "com.sendbird.uikit")
93+
if let build = bundle?.infoDictionary?[kCFBundleVersionKey as String] {
94+
return "\(build)"
95+
}
96+
97+
return nil
98+
}
99+
100+
public static func shortVersionString() -> String? {
101+
let bundle = Bundle(identifier: "com.sendbird.uikit")
102+
if let shortVersion = bundle?.infoDictionary?["CFBundleShortVersionString"] {
103+
return "\(shortVersion)"
104+
}
105+
106+
return nil
107+
}
108+
85109

86110
// MARK: - Push Notification
87111
public static func registerPush(deviceToken: Data, completionHandler: @escaping (_ success: Bool) -> Void) {

SendBirdUIKit.framework/Headers/SendBirdUIKit-Swift.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ SWIFT_CLASS("_TtC13SendBirdUIKit24SBUChannelViewController")
572572
- (void)sendDocumentFileMessageWithDocumentUrls:(NSArray<NSURL *> * _Nonnull)documentUrls;
573573
- (void)onClickBack;
574574
- (void)onClickSetting;
575-
- (void)scrollToTop;
575+
- (void)scrollToBottom;
576576
- (void)registerWithAdminMessageCell:(SBUBaseMessageCell * _Nonnull)adminMessageCell nib:(UINib * _Nullable)nib;
577577
- (void)registerWithUserMessageCell:(SBUBaseMessageCell * _Nonnull)userMessageCell nib:(UINib * _Nullable)nib;
578578
- (void)registerWithFileMessageCell:(SBUBaseMessageCell * _Nonnull)fileMessageCell nib:(UINib * _Nullable)nib;
@@ -1099,7 +1099,9 @@ SWIFT_CLASS("_TtC13SendBirdUIKit7SBUMain")
10991099
+ (void)connectionCheckWithCompletionHandler:(void (^ _Nonnull)(SBDUser * _Nullable, SBDError * _Nullable))completionHandler;
11001100
+ (void)disconnectWithCompletionHandler:(void (^ _Nullable)(void))completionHandler;
11011101
+ (void)updateUserInfoWithNickname:(NSString * _Nullable)nickname profileUrl:(NSString * _Nullable)profileUrl completionHandler:(void (^ _Nullable)(SBDError * _Nullable))completionHandler;
1102-
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT;
1102+
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("", "shortVersionString");
1103+
+ (NSString * _Nullable)versionString SWIFT_WARN_UNUSED_RESULT;
1104+
+ (NSString * _Nullable)shortVersionString SWIFT_WARN_UNUSED_RESULT;
11031105
+ (void)registerPushWithDeviceToken:(NSData * _Nonnull)deviceToken completionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
11041106
+ (void)unregisterPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
11051107
+ (void)unregisterAllPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
@@ -2150,7 +2152,7 @@ SWIFT_CLASS("_TtC13SendBirdUIKit24SBUChannelViewController")
21502152
- (void)sendDocumentFileMessageWithDocumentUrls:(NSArray<NSURL *> * _Nonnull)documentUrls;
21512153
- (void)onClickBack;
21522154
- (void)onClickSetting;
2153-
- (void)scrollToTop;
2155+
- (void)scrollToBottom;
21542156
- (void)registerWithAdminMessageCell:(SBUBaseMessageCell * _Nonnull)adminMessageCell nib:(UINib * _Nullable)nib;
21552157
- (void)registerWithUserMessageCell:(SBUBaseMessageCell * _Nonnull)userMessageCell nib:(UINib * _Nullable)nib;
21562158
- (void)registerWithFileMessageCell:(SBUBaseMessageCell * _Nonnull)fileMessageCell nib:(UINib * _Nullable)nib;
@@ -2677,7 +2679,9 @@ SWIFT_CLASS("_TtC13SendBirdUIKit7SBUMain")
26772679
+ (void)connectionCheckWithCompletionHandler:(void (^ _Nonnull)(SBDUser * _Nullable, SBDError * _Nullable))completionHandler;
26782680
+ (void)disconnectWithCompletionHandler:(void (^ _Nullable)(void))completionHandler;
26792681
+ (void)updateUserInfoWithNickname:(NSString * _Nullable)nickname profileUrl:(NSString * _Nullable)profileUrl completionHandler:(void (^ _Nullable)(SBDError * _Nullable))completionHandler;
2680-
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT;
2682+
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("", "shortVersionString");
2683+
+ (NSString * _Nullable)versionString SWIFT_WARN_UNUSED_RESULT;
2684+
+ (NSString * _Nullable)shortVersionString SWIFT_WARN_UNUSED_RESULT;
26812685
+ (void)registerPushWithDeviceToken:(NSData * _Nonnull)deviceToken completionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
26822686
+ (void)unregisterPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
26832687
+ (void)unregisterAllPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
@@ -3730,7 +3734,7 @@ SWIFT_CLASS("_TtC13SendBirdUIKit24SBUChannelViewController")
37303734
- (void)sendDocumentFileMessageWithDocumentUrls:(NSArray<NSURL *> * _Nonnull)documentUrls;
37313735
- (void)onClickBack;
37323736
- (void)onClickSetting;
3733-
- (void)scrollToTop;
3737+
- (void)scrollToBottom;
37343738
- (void)registerWithAdminMessageCell:(SBUBaseMessageCell * _Nonnull)adminMessageCell nib:(UINib * _Nullable)nib;
37353739
- (void)registerWithUserMessageCell:(SBUBaseMessageCell * _Nonnull)userMessageCell nib:(UINib * _Nullable)nib;
37363740
- (void)registerWithFileMessageCell:(SBUBaseMessageCell * _Nonnull)fileMessageCell nib:(UINib * _Nullable)nib;
@@ -4257,7 +4261,9 @@ SWIFT_CLASS("_TtC13SendBirdUIKit7SBUMain")
42574261
+ (void)connectionCheckWithCompletionHandler:(void (^ _Nonnull)(SBDUser * _Nullable, SBDError * _Nullable))completionHandler;
42584262
+ (void)disconnectWithCompletionHandler:(void (^ _Nullable)(void))completionHandler;
42594263
+ (void)updateUserInfoWithNickname:(NSString * _Nullable)nickname profileUrl:(NSString * _Nullable)profileUrl completionHandler:(void (^ _Nullable)(SBDError * _Nullable))completionHandler;
4260-
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT;
4264+
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("", "shortVersionString");
4265+
+ (NSString * _Nullable)versionString SWIFT_WARN_UNUSED_RESULT;
4266+
+ (NSString * _Nullable)shortVersionString SWIFT_WARN_UNUSED_RESULT;
42614267
+ (void)registerPushWithDeviceToken:(NSData * _Nonnull)deviceToken completionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
42624268
+ (void)unregisterPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
42634269
+ (void)unregisterAllPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
@@ -5308,7 +5314,7 @@ SWIFT_CLASS("_TtC13SendBirdUIKit24SBUChannelViewController")
53085314
- (void)sendDocumentFileMessageWithDocumentUrls:(NSArray<NSURL *> * _Nonnull)documentUrls;
53095315
- (void)onClickBack;
53105316
- (void)onClickSetting;
5311-
- (void)scrollToTop;
5317+
- (void)scrollToBottom;
53125318
- (void)registerWithAdminMessageCell:(SBUBaseMessageCell * _Nonnull)adminMessageCell nib:(UINib * _Nullable)nib;
53135319
- (void)registerWithUserMessageCell:(SBUBaseMessageCell * _Nonnull)userMessageCell nib:(UINib * _Nullable)nib;
53145320
- (void)registerWithFileMessageCell:(SBUBaseMessageCell * _Nonnull)fileMessageCell nib:(UINib * _Nullable)nib;
@@ -5835,7 +5841,9 @@ SWIFT_CLASS("_TtC13SendBirdUIKit7SBUMain")
58355841
+ (void)connectionCheckWithCompletionHandler:(void (^ _Nonnull)(SBDUser * _Nullable, SBDError * _Nullable))completionHandler;
58365842
+ (void)disconnectWithCompletionHandler:(void (^ _Nullable)(void))completionHandler;
58375843
+ (void)updateUserInfoWithNickname:(NSString * _Nullable)nickname profileUrl:(NSString * _Nullable)profileUrl completionHandler:(void (^ _Nullable)(SBDError * _Nullable))completionHandler;
5838-
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT;
5844+
+ (NSString * _Nonnull)getUIKitVersion SWIFT_WARN_UNUSED_RESULT SWIFT_DEPRECATED_MSG("", "shortVersionString");
5845+
+ (NSString * _Nullable)versionString SWIFT_WARN_UNUSED_RESULT;
5846+
+ (NSString * _Nullable)shortVersionString SWIFT_WARN_UNUSED_RESULT;
58395847
+ (void)registerPushWithDeviceToken:(NSData * _Nonnull)deviceToken completionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
58405848
+ (void)unregisterPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;
58415849
+ (void)unregisterAllPushTokenWithCompletionHandler:(void (^ _Nonnull)(BOOL))completionHandler;

SendBirdUIKit.framework/Info.plist

0 Bytes
Binary file not shown.

SendBirdUIKit.framework/Modules/SendBirdUIKit.swiftmodule/arm.swiftinterface

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public typealias SBUNewMessageInfoHandler = () -> Swift.Void
204204
@objc public func sendDocumentFileMessage(documentUrls: [Foundation.URL])
205205
@objc public func onClickBack()
206206
@objc public func onClickSetting()
207-
@objc public func scrollToTop()
207+
@objc public func scrollToBottom()
208208
@objc public func register(adminMessageCell: SendBirdUIKit.SBUBaseMessageCell, nib: UIKit.UINib? = nil)
209209
@objc public func register(userMessageCell: SendBirdUIKit.SBUBaseMessageCell, nib: UIKit.UINib? = nil)
210210
@objc public func register(fileMessageCell: SendBirdUIKit.SBUBaseMessageCell, nib: UIKit.UINib? = nil)
@@ -581,7 +581,10 @@ extension UINavigationController {
581581
@objc public static func connectionCheck(completionHandler: @escaping (SendBirdSDK.SBDUser?, SendBirdSDK.SBDError?) -> Swift.Void)
582582
@objc public static func disconnect(completionHandler: (() -> Swift.Void)?)
583583
@objc public static func updateUserInfo(nickname: Swift.String?, profileUrl: Swift.String?, completionHandler: ((SendBirdSDK.SBDError?) -> Swift.Void)?)
584-
@objc public static func getUIKitVersion() -> Swift.String
584+
@objc @available(*, deprecated, renamed: "shortVersionString()")
585+
public static func getUIKitVersion() -> Swift.String
586+
@objc public static func versionString() -> Swift.String?
587+
@objc public static func shortVersionString() -> Swift.String?
585588
@objc public static func registerPush(deviceToken: Foundation.Data, completionHandler: @escaping (Swift.Bool) -> Swift.Void)
586589
@objc public static func unregisterPushToken(completionHandler: @escaping (Swift.Bool) -> Swift.Void)
587590
@objc public static func unregisterAllPushToken(completionHandler: @escaping (Swift.Bool) -> Swift.Void)

0 commit comments

Comments
 (0)