Skip to content

Commit f13e171

Browse files
committed
* Supported - Custom SBDChanngeListQuery in the initialization function of SBUChannelListViewController
* Supported - Custom `SBDMessageListParams` in the initialization function of `SBUChannelViewController` * Added - Unknown type message
1 parent e1e8678 commit f13e171

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+754
-270
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Change Log
22

3+
### v1.0.11 (Jun 25, 2020)
4+
* Supported - Custom `SBDChanngeListQuery` in the initialization function of `SBUChannelListViewController`
5+
* Supported - Custom `SBDMessageListParams` in the initialization function of `SBUChannelViewController`
6+
* Added - Unknown type message
7+
38
### v1.0.10 (Jun 18, 2020)
49
* Fixed - Incorrect operator check logic in frozen group channel
510

611
### v1.0.9 (Jun 8, 2020)
7-
* Supported customized params, Changed access control
12+
* Supported - customized params, Changed access control
813
* **`SBUChannelViewController`**
914
* `channel`, `messageList`, `resendableMessages` properties
1015
* `sendUserMessage(messageParams:)`

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The minimum requirements for UIKit for iOS are:
3939

4040
* `iOS 10.3+`
4141
* `Swift 4.2+` / `Objective-C`
42-
* `Sendbird Chat SDK for iOS 3.0.182+`
42+
* `Sendbird Chat SDK for iOS 3.0.186+`
4343

4444
---
4545

@@ -87,16 +87,16 @@ $ pod install
8787
$ pod update
8888
```
8989

90-
> __Note__: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. If you install the UIKit, `CocoaPods` will automatically install the Chat SDK for iOS as well. The minimum requirement of the Chat SDK for iOS is 3.0.182 or higher.
90+
> __Note__: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. If you install the UIKit, `CocoaPods` will automatically install the Chat SDK for iOS as well. The minimum requirement of the Chat SDK for iOS is 3.0.186 or higher.
9191
9292
#### Carthage
9393

9494
1. Add `SendBirdUIKit` and `SendBirdSDK` into your `Cartfile` as below:
95-
> __Note__: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. The minimum requirement of the Chat SDK for iOS is 3.0.182 or higher.
95+
> __Note__: Sendbird UIKit for iOS is Sendbird Chat SDK-dependent. The minimum requirement of the Chat SDK for iOS is 3.0.186 or higher.
9696
9797
```bash
9898
github "sendbird/sendbird-uikit-ios"
99-
github "sendbird/sendbird-ios-framework" == 3.0.182
99+
github "sendbird/sendbird-ios-framework" == 3.0.186
100100
```
101101

102102
2. Install the `SendBirdUIKit` framework through `Carthage`.

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.10</string>
16+
<string>1.0.11</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
242 KB
Binary file not shown.

SendBirdUIKit.framework/Assets.car

0 Bytes
Binary file not shown.

SendBirdUIKit.framework/Headers/SBUChannelListViewController.swift

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77
//
88

99
import UIKit
10+
import SendBirdSDK
1011

1112
@objcMembers
1213
open class SBUChannelListViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, SBDChannelDelegate, SBDConnectionDelegate, SBUEmptyViewDelegate {
1314

14-
// MARK: - Public property
15-
// for UI
15+
// MARK: - UI properties (Public)
1616
public lazy var leftBarButton: UIBarButtonItem? = _leftBarButton
1717
public lazy var rightBarButton: UIBarButtonItem? = _rightBarButton
1818

1919

20-
// MARK: - Private property
21-
// for UI
20+
// MARK: - UI properties (Private)
2221
var theme: SBUChannelListTheme = SBUTheme.channelListTheme
2322

2423
private lazy var titleView: SBUNavigationTitleView = _titleView
@@ -52,9 +51,21 @@ open class SBUChannelListViewController: UIViewController, UITableViewDelegate,
5251
return emptyView
5352
}()
5453

55-
// for Logic
54+
55+
// MARK: - Logic properties (Public)
56+
57+
/// This object has a list of all channels.
5658
@SBUAtomic public private(set) var channelList: [SBDGroupChannel] = []
57-
var channelListQuery: SBDGroupChannelListQuery?
59+
60+
/// This is a query used to get a list of channels. Only getter is provided, please use initialization function to set query directly.
61+
/// - note: For query properties, see `SBDGroupChannelListQuery` class.
62+
/// - Since: 1.0.11
63+
public private(set) var channelListQuery: SBDGroupChannelListQuery?
64+
65+
66+
// MARK: - Logic properties (Private)
67+
var customizedChannelListQuery: SBDGroupChannelListQuery? = nil
68+
5869
var lastUpdatedTimestamp: Int64 = 0
5970
var lastUpdatedToken: String? = nil
6071
var isLoading = false
@@ -65,18 +76,31 @@ open class SBUChannelListViewController: UIViewController, UITableViewDelegate,
6576
var channelCell: SBUBaseChannelCell? = nil
6677
var customCell: SBUBaseChannelCell? = nil
6778

79+
6880
// MARK: - Lifecycle
6981
@available(*, unavailable, renamed: "SBUChannelListViewController()")
7082
required public init?(coder: NSCoder) {
7183
super.init(coder: coder)
7284
SBULog.info("")
7385
}
7486

75-
/// If you have channel object, use this initialize function.
76-
/// - Parameter channel: Channel object
77-
public init() {
87+
/// You can initialize the class through this function.
88+
/// If you have `channelListQuery`, please set it. If not set, it is used as default value.
89+
///
90+
/// See the example below for query generation.
91+
/// ````
92+
/// let query = SBDGroupChannel.createMyGroupChannelListQuery()
93+
/// query.includeEmptyChannel = false
94+
/// query.includeFrozenChannel = true
95+
/// ...
96+
/// ````
97+
/// - Parameter channelListQuery: Your own `SBDGroupChannelListQuery` object
98+
/// - Since: 1.0.11
99+
public init(channelListQuery: SBDGroupChannelListQuery? = nil) {
78100
super.init(nibName: nil, bundle: nil)
79101
SBULog.info("")
102+
103+
self.customizedChannelListQuery = channelListQuery
80104
}
81105

82106
open override func loadView() {
@@ -242,10 +266,14 @@ open class SBUChannelListViewController: UIViewController, UITableViewDelegate,
242266
}
243267

244268
if self.channelListQuery == nil {
245-
self.channelListQuery = SBDGroupChannel.createMyGroupChannelListQuery()
246-
self.channelListQuery?.order = .latestLastMessage
247-
self.channelListQuery?.limit = self.limit
248-
self.channelListQuery?.includeEmptyChannel = self.includeEmptyChannel
269+
if let query = self.customizedChannelListQuery?.copy() as? SBDGroupChannelListQuery {
270+
self.channelListQuery = query
271+
} else {
272+
self.channelListQuery = SBDGroupChannel.createMyGroupChannelListQuery()
273+
self.channelListQuery?.order = .latestLastMessage
274+
self.channelListQuery?.limit = self.limit
275+
self.channelListQuery?.includeEmptyChannel = self.includeEmptyChannel
276+
}
249277
}
250278

251279
guard self.channelListQuery?.hasNext == true else {
@@ -281,9 +309,10 @@ open class SBUChannelListViewController: UIViewController, UITableViewDelegate,
281309
return
282310
}
283311

284-
let channelLogsParams = SBDGroupChannelChangeLogsParams()
285-
channelLogsParams.includeEmptyChannel = self.includeEmptyChannel
286-
channelLogsParams.includeFrozenChannel = true
312+
var channelLogsParams = SBDGroupChannelChangeLogsParams()
313+
if let channelListQuery = self.channelListQuery {
314+
channelLogsParams = SBDGroupChannelChangeLogsParams.create(with: channelListQuery)
315+
}
287316

288317
if let token = token {
289318
SBULog.info("[Request] Channel change logs with token")
@@ -407,7 +436,11 @@ open class SBUChannelListViewController: UIViewController, UITableViewDelegate,
407436
/// If you want to use a custom channelViewController, override it and implement it.
408437
/// - Parameter channelUrl: channel url for use in channelViewController.
409438
open func showChannel(channelUrl: String) {
410-
let channelVC = SBUChannelViewController(channelUrl: channelUrl)
439+
let params = SBDMessageListParams()
440+
params.includeMetaArray = true
441+
params.includeReactions = true
442+
params.includeReplies = true
443+
let channelVC = SBUChannelViewController(channelUrl: channelUrl, messageListParams: params)
411444
self.navigationController?.pushViewController(channelVC, animated: true)
412445
}
413446

0 commit comments

Comments
 (0)