Skip to content

Commit d836014

Browse files
pushpsenairekar2911pushpsenairekar2911
authored andcommitted
v2.3.0-1
1 parent 2711149 commit d836014

File tree

159 files changed

+16554
-5151
lines changed

Some content is hidden

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

159 files changed

+16554
-5151
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ assignees: ''
1010

1111

1212

13-
1413
**Describe the bug**
1514
A clear and concise description of what the bug is.
1615

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ email, or any other method with the owners of this repository before making a ch
66
Please note we have a code of conduct, please follow it in all your interactions with the project.
77

88

9-
109
## Pull Request Process
1110

1211
1. Ensure any install or build dependencies are removed before the end of the layer when doing a

CometChatObjc/CometChatObjc.xcodeproj/project.pbxproj

Lines changed: 2696 additions & 2377 deletions
Large diffs are not rendered by default.

CometChatObjc/CometChatObjc/Library/UI Components/Calls/Call Logs/CometChatCallDetail.swift

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ class CometChatCallDetails: UIViewController {
134134
progressIndicator.LoadingLabel.text = "Unable to fetch History."
135135
self.tableView.reloadRows(at: [indexPath], with: .automatic)
136136
}
137-
if let errorMessage = error?.errorDescription {
138-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
139-
snackbar.show()
137+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
138+
if errorCode.isLocalized {
139+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
140+
}else{
141+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
142+
}
140143
}
141144
}
142145

@@ -454,15 +457,17 @@ extension CometChatCallDetails: UITableViewDelegate , UITableViewDataSource {
454457
if let user = self.currentUser, let name = user.name {
455458
self.set(user: user)
456459
DispatchQueue.main.async {
457-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: name + " " + "UNBLOCKED_SUCCESSFULLY".localized(), duration: .short)
458-
snackbar.show()
460+
CometChatSnackBoard.display(message: name + " " + "UNBLOCKED_SUCCESSFULLY".localized(), mode: .success, duration: .short)
459461
}
460462
}
461463
}) { (error) in
462464
DispatchQueue.main.async {
463-
if let errorMessage = error?.errorDescription {
464-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
465-
snackbar.show()
465+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
466+
if errorCode.isLocalized {
467+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
468+
}else{
469+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
470+
}
466471
}
467472
}
468473
}
@@ -473,15 +478,17 @@ extension CometChatCallDetails: UITableViewDelegate , UITableViewDataSource {
473478
self.set(user: user)
474479
let data:[String: String] = ["name": name]
475480
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "didUserBlocked"), object: nil, userInfo: data)
476-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: name + " " + "BLOCKED_SUCCESSFULLY".localized(), duration: .short)
477-
snackbar.show()
481+
CometChatSnackBoard.display(message: name + " " + "BLOCKED_SUCCESSFULLY".localized(), mode: .success, duration: .short)
478482
}
479483
}
480484
}) { (error) in
481485
DispatchQueue.main.async {
482-
if let errorMessage = error?.errorDescription {
483-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
484-
snackbar.show()
486+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
487+
if errorCode.isLocalized {
488+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
489+
}else{
490+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
491+
}
485492
}
486493
}
487494

@@ -495,16 +502,18 @@ extension CometChatCallDetails: UITableViewDelegate , UITableViewDataSource {
495502
self.dismiss(animated: true) {
496503
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "didGroupDeleted"), object: nil, userInfo: nil)
497504
let message = "YOU_LEFT_FROM".localized() + " " + (self.currentGroup?.name ?? "") + "."
498-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: message, duration: .short)
499-
snackbar.show()
505+
CometChatSnackBoard.display(message: message, mode: .success, duration: .short)
500506
}
501507

502508
}
503509
}) { (error) in
504510
DispatchQueue.main.async {
505-
if let errorMessage = error?.errorDescription {
506-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
507-
snackbar.show()
511+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
512+
if errorCode.isLocalized {
513+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
514+
}else{
515+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
516+
}
508517
}
509518
}
510519

CometChatObjc/CometChatObjc/Library/UI Components/Calls/Call Logs/CometChatCallsList.swift

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ public class CometChatCallsList: UIViewController {
133133

134134
}, onError: { (error) in
135135
DispatchQueue.main.async {
136-
if let errorMessage = error?.errorDescription {
137-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
138-
snackbar.show()
136+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
137+
if errorCode.isLocalized {
138+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
139+
}else{
140+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
141+
}
139142
}
140143
}
141144

@@ -181,11 +184,14 @@ public class CometChatCallsList: UIViewController {
181184
}
182185
}, onError: { (error) in
183186
DispatchQueue.main.async {
184-
if let errorMessage = error?.errorDescription {
187+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
185188
self.activityIndicator?.stopAnimating()
186189
self.tableView.tableFooterView?.isHidden = true
187-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
188-
snackbar.show()
190+
if errorCode.isLocalized {
191+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
192+
}else{
193+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
194+
}
189195
}
190196
}
191197

@@ -527,13 +533,17 @@ extension CometChatCallsList: UITableViewDelegate , UITableViewDataSource {
527533
self.tableView.deleteRows(at: [indexPath], with: .automatic)
528534
self.tableView.endUpdates()
529535

530-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "Call Deleted", duration: .short)
531-
snackbar.show()
536+
CometChatSnackBoard.display(message: "Call Deleted", mode: .info, duration: .short)
532537
}
533538
}) { (error) in
534539
DispatchQueue.main.async {
535-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: error.errorDescription, duration: .short)
536-
snackbar.show()
540+
if let errorCode = error.errorCode as? String, let errorDescription = error.errorDescription as? String{
541+
if errorCode.isLocalized {
542+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
543+
}else{
544+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
545+
}
546+
}
537547
}
538548
}
539549
}

CometChatObjc/CometChatObjc/Library/UI Components/Calls/Call Logs/CometChatNewCallList.swift

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,12 @@ public class CometChatNewCallList: UIViewController {
158158
self.tableView.tableFooterView?.isHidden = true}
159159
}) { (error) in
160160
DispatchQueue.main.async {
161-
if let errorMessage = error?.errorDescription {
162-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
163-
snackbar.show()
161+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
162+
if errorCode.isLocalized {
163+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
164+
}else{
165+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
166+
}
164167
}
165168
}
166169

@@ -205,9 +208,12 @@ public class CometChatNewCallList: UIViewController {
205208
self.tableView.tableFooterView?.isHidden = true}
206209
}) { (error) in
207210
DispatchQueue.main.async {
208-
if let errorMessage = error?.errorDescription {
209-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: errorMessage, duration: .short)
210-
snackbar.show()
211+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
212+
if errorCode.isLocalized {
213+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
214+
}else{
215+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
216+
}
211217
}
212218
}
213219
}
@@ -538,6 +544,9 @@ extension CometChatNewCallList : UISearchBarDelegate, UISearchResultsUpdating {
538544
if users.count != 0 {
539545
self.filteredUsers = users
540546
DispatchQueue.main.async(execute: {self.tableView.reloadData()})
547+
}else{
548+
self.filteredUsers = []
549+
DispatchQueue.main.async(execute: {self.tableView.reloadData()})
541550
}
542551
}) { (error) in
543552

CometChatObjc/CometChatObjc/Library/UI Components/Calls/Call Manager/CometChatCallManager.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ import CometChatPro
4343
@objc public func makeCall(call: CometChat.CallType, to: AppEntity){
4444
if let user = to as? User {
4545
if user.blockedByMe == true {
46-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "Kindly, unblock the user to make a call.", duration: .short)
47-
snackbar.show()
46+
CometChatSnackBoard.display(message: "UNBLOCK_USER_MESSAGE".localized(), mode: .error, duration: .short)
47+
4848
}else{
4949
DispatchQueue.main.async {
5050
let outgoingCall = CometChatOutgoingCall()
@@ -96,8 +96,7 @@ import CometChatPro
9696
// MARK: - CometChatCallDelegate Methods (For Swift Project)
9797
//
9898
// Since, Objective C dosen't extend Appdelegate, kindly register for `CometChatCallDelegate` in AppDelegate and add those methods in AppDelegate.
99-
100-
99+
//@available(iOS 11, *)
101100
//extension AppDelegate : CometChatCallDelegate {
102101
//
103102
// /**

CometChatObjc/CometChatObjc/Library/UI Components/Calls/Create Meeting/CometChatMeetingView.swift

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CometChatMeetingView: UIViewController {
1616
override func viewDidLoad() {
1717
super.viewDidLoad()
1818

19-
print("CometChatMeetingView viewDidLoad")
19+
2020

2121
}
2222

@@ -40,7 +40,7 @@ class CometChatMeetingView: UIViewController {
4040
DispatchQueue.main.async { [weak self] in
4141
guard let strongSelf = self else { return }
4242

43-
let callSettings = CallSettings.CallSettingsBuilder(callView: strongSelf.customView, sessionId: sessionID).setAudioOnlyCall(audioOnly: false).build()
43+
let callSettings = CallSettings.CallSettingsBuilder(callView: strongSelf.customView, sessionId: sessionID).setAudioOnlyCall(audioOnly: false).startWithAudioMuted(audioMuted: false).build()
4444

4545
CometChat.startCall(callSettings: callSettings, userJoined: { (userJoined) in
4646
DispatchQueue.main.async {
@@ -56,26 +56,27 @@ class CometChatMeetingView: UIViewController {
5656
snackbar.show()
5757
}
5858
}
59-
}, onError: { (error) in
60-
DispatchQueue.main.async {
61-
62-
strongSelf.dismiss(animated: true, completion: nil)
63-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "Unable to start call.", duration: .short)
64-
snackbar.show()
59+
}, userListUpdated: {(userListUpdated) in }, onError: { (error) in
60+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
61+
if errorCode.isLocalized {
62+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
63+
}else{
64+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
65+
}
6566
}
6667
}) { (ended) in
6768
DispatchQueue.main.async {
68-
strongSelf.dismiss(animated: true, completion: nil)
69-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "CALL_ENDED".localized(), duration: .short)
70-
snackbar.show()
69+
strongSelf.dismiss(animated: true) {
70+
CometChatSnackBoard.display(message: "CALL_ENDED".localized(), mode: .info, duration: .short)
71+
}
7172
}
7273
}
7374
}
7475
case .video:
7576
DispatchQueue.main.async { [weak self] in
7677
guard let strongSelf = self else { return }
7778

78-
let callSettings = CallSettings.CallSettingsBuilder(callView: strongSelf.customView, sessionId: sessionID).setAudioOnlyCall(audioOnly: false).build()
79+
let callSettings = CallSettings.CallSettingsBuilder(callView: strongSelf.customView, sessionId: sessionID).setAudioOnlyCall(audioOnly: false).startWithVideoMuted(videoMuted: false).startWithAudioMuted(audioMuted: false).build()
7980

8081
CometChat.startCall(callSettings: callSettings, userJoined: { (userJoined) in
8182
DispatchQueue.main.async {
@@ -91,21 +92,28 @@ class CometChatMeetingView: UIViewController {
9192
snackbar.show()
9293
}
9394
}
95+
}, userListUpdated: {(userListUpdated) in
96+
9497
}, onError: { (error) in
9598
DispatchQueue.main.async {
96-
9799
strongSelf.view.removeFromSuperview()
98100
strongSelf.dismiss(animated: true, completion: nil)
99-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "Unable to start call.", duration: .short)
100-
snackbar.show()
101+
if let errorCode = error?.errorCode, let errorDescription = error?.errorDescription {
102+
if errorCode.isLocalized {
103+
CometChatSnackBoard.display(message: errorCode.localized() , mode: .error, duration: .short)
104+
}else{
105+
CometChatSnackBoard.display(message: errorDescription , mode: .error, duration: .short)
106+
}
107+
}
101108
}
102109
}) { (callEnded) in
103110
DispatchQueue.main.async {
104111

105112
strongSelf.view.removeFromSuperview()
106-
strongSelf.dismiss(animated: true, completion: nil)
107-
let snackbar: CometChatSnackbar = CometChatSnackbar.init(message: "CALL_ENDED".localized(), duration: .short)
108-
snackbar.show()
113+
114+
strongSelf.dismiss(animated: true) {
115+
CometChatSnackBoard.display(message: "CALL_ENDED".localized(), mode: .info, duration: .short)
116+
}
109117
}
110118
}
111119
}

0 commit comments

Comments
 (0)