Skip to content

Commit 04249ee

Browse files
Merge pull request #418 from Kommunicate-io/release/7.1.7
Release/7.1.7
2 parents 01b74ca + 9961576 commit 04249ee

11 files changed

Lines changed: 78 additions & 47 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# CHANGELOG
22

33
The changelog for [Kommunicate-iOS-SDK](https://github.com/Kommunicate-io/Kommunicate-iOS-SDK). Also see the [releases](https://github.com/Kommunicate-io/Kommunicate-iOS-SDK/releases) on Github.
4+
## [7.1.7] 2024-04-10
5+
- Iframe Support for HTML Content
6+
- Added prefix to the files to avoid build issue in case of same name is used by other libraries
7+
- Added support for conversation deletion sync.
8+
49
## [7.1.6] 2024-03-15
510
- Fixed name getting cut issue in Navigation Bar.
611
- Improved the Flow of Showing Rating Bar.

Example/Podfile.lock

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
PODS:
2-
- CwlCatchException (2.1.2):
3-
- CwlCatchExceptionSupport (~> 2.1.2)
4-
- CwlCatchExceptionSupport (2.1.2)
5-
- CwlMachBadInstructionHandler (2.1.2)
6-
- CwlPosixPreconditionTesting (2.1.2)
7-
- CwlPreconditionTesting (2.1.2):
8-
- CwlCatchException (~> 2.1.2)
9-
- CwlMachBadInstructionHandler (~> 2.1.2)
10-
- CwlPosixPreconditionTesting (~> 2.1.2)
2+
- CwlCatchException (2.2.0):
3+
- CwlCatchExceptionSupport (~> 2.2.0)
4+
- CwlCatchExceptionSupport (2.2.0)
5+
- CwlMachBadInstructionHandler (2.2.0)
6+
- CwlPosixPreconditionTesting (2.2.0)
7+
- CwlPreconditionTesting (2.2.1):
8+
- CwlCatchException (~> 2.2.0)
9+
- CwlMachBadInstructionHandler (~> 2.2.0)
10+
- CwlPosixPreconditionTesting (~> 2.2.0)
1111
- iOSDropDown (0.4.0)
1212
- iOSSnapshotTestCase (8.0.0):
1313
- iOSSnapshotTestCase/SwiftSupport (= 8.0.0)
1414
- iOSSnapshotTestCase/Core (8.0.0)
1515
- iOSSnapshotTestCase/SwiftSupport (8.0.0):
1616
- iOSSnapshotTestCase/Core
1717
- Kingfisher (7.6.2)
18-
- Kommunicate (7.1.6):
19-
- KommunicateChatUI-iOS-SDK (~> 1.3.0)
20-
- KommunicateChatUI-iOS-SDK (1.3.0):
21-
- KommunicateChatUI-iOS-SDK/Complete (= 1.3.0)
22-
- KommunicateChatUI-iOS-SDK/Complete (1.3.0):
18+
- Kommunicate (7.1.7):
19+
- KommunicateChatUI-iOS-SDK (~> 1.3.1)
20+
- KommunicateChatUI-iOS-SDK (1.3.1):
21+
- KommunicateChatUI-iOS-SDK/Complete (= 1.3.1)
22+
- KommunicateChatUI-iOS-SDK/Complete (1.3.1):
2323
- iOSDropDown
2424
- Kingfisher (~> 7.6.2)
2525
- KommunicateChatUI-iOS-SDK/RichMessageKit
26-
- KommunicateCore-iOS-SDK (~> 1.1.8)
26+
- KommunicateCore-iOS-SDK (~> 1.1.9)
2727
- SwipeCellKit (~> 2.7.1)
2828
- ZendeskChatProvidersSDK (~> 3.0.0)
29-
- KommunicateChatUI-iOS-SDK/RichMessageKit (1.3.0)
30-
- KommunicateCore-iOS-SDK (1.1.8)
31-
- Nimble (13.1.2):
32-
- CwlPreconditionTesting (~> 2.1.0)
29+
- KommunicateChatUI-iOS-SDK/RichMessageKit (1.3.1)
30+
- KommunicateCore-iOS-SDK (1.1.9)
31+
- Nimble (13.3.0):
32+
- CwlPreconditionTesting (~> 2.2.0)
3333
- Nimble-Snapshots (9.7.0):
3434
- Nimble-Snapshots/Core (= 9.7.0)
3535
- Nimble-Snapshots/Core (9.7.0):
3636
- iOSSnapshotTestCase (~> 8.0)
3737
- Nimble (~> 13.0)
38-
- Quick (7.4.1)
38+
- Quick (7.5.0)
3939
- SwipeCellKit (2.7.1)
4040
- ZendeskChatProvidersSDK (3.0.0)
4141

@@ -69,20 +69,20 @@ EXTERNAL SOURCES:
6969
:path: "../"
7070

7171
SPEC CHECKSUMS:
72-
CwlCatchException: 76542d5ea479c79ce16ddd6e7bc9d42c7ec63300
73-
CwlCatchExceptionSupport: 42bf8c5e4e5e663f51100ddfa68caf7cfcf64ab6
74-
CwlMachBadInstructionHandler: b982c7e3e44fcfa1c680e8046f6bba35f3476d65
75-
CwlPosixPreconditionTesting: 4011f0660c0be460b088d10bcfdf351c7e036ac4
76-
CwlPreconditionTesting: 23ed728f2acc2d774fb59101123c943ce0119107
72+
CwlCatchException: 51bf8319009a31104ea6f0568730d1ecc25b6454
73+
CwlCatchExceptionSupport: 1345d6adb01a505933f2bc972dab60dcb9ce3e50
74+
CwlMachBadInstructionHandler: ea1030428925d9bf340882522af30712fb4bf356
75+
CwlPosixPreconditionTesting: a125dee731883f2582715f548c6b6c92c7fde145
76+
CwlPreconditionTesting: ccfd08aca58d14e04062b2a3dd2fd52e09857453
7777
iOSDropDown: ce9daa584eaa5567cafc1b633e3cc7eb6d9cea42
7878
iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f
7979
Kingfisher: 6c5449c6450c5239166510ba04afe374a98afc4f
80-
Kommunicate: 4f976cfb250c7bb80d44067307cf6741d68253ed
81-
KommunicateChatUI-iOS-SDK: 6eb714cb6975ab2ff39bf04f11b310e1b6da24d2
82-
KommunicateCore-iOS-SDK: 87c6e7c9f0e1e32d258c36b70ba20ffbd4428c90
83-
Nimble: d733c860d832b324e9779034f12398993c536e7b
80+
Kommunicate: cd7d29ae242d426272738eb3d91210ef8ca8d866
81+
KommunicateChatUI-iOS-SDK: f067262ef4ac1a766a5921f3f5b488060538c14d
82+
KommunicateCore-iOS-SDK: d8c46aea82b1090effb568f2aaf1938f31f8e0b5
83+
Nimble: 3ac6c6b0b7e9835d1540b6507d8054b12a415536
8484
Nimble-Snapshots: 7f2710c507469eb0fc4912f45d0f280e15f91966
85-
Quick: 6afbb0e4554ca0032a90c144f4ab71cd433e7dac
85+
Quick: 2b651168441479b949ba987f3cee41a9cc53aa32
8686
SwipeCellKit: 3972254a826da74609926daf59b08d6c72e619ea
8787
ZendeskChatProvidersSDK: af93e02e2058875f92e6ad86e74ee51203b4079e
8888

Kommunicate.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Kommunicate'
3-
s.version = '7.1.6'
3+
s.version = '7.1.7'
44
s.summary = 'Kommunicate iOS SDK for customer support.'
55
s.homepage = 'https://github.com/Kommunicate-io/Kommunicate-iOS-SDK'
66
s.license = { :type => 'BSD-3-Clause', :file => 'LICENSE' }
@@ -10,5 +10,5 @@ Pod::Spec.new do |s|
1010
s.swift_version = '5.0'
1111
s.source_files = 'Sources/Kommunicate/Classes/**/*.{swift}'
1212
s.resources = 'Sources/Resources/**/*{lproj,storyboard,xib,xcassets,json,strings}'
13-
s.dependency 'KommunicateChatUI-iOS-SDK' , '~> 1.3.0'
13+
s.dependency 'KommunicateChatUI-iOS-SDK' , '~> 1.3.1'
1414
end

Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let package = Package(
1313
),
1414
],
1515
dependencies: [
16-
.package(name: "KommunicateChatUI-iOS-SDK", url: "https://github.com/Kommunicate-io/KommunicateChatUI-iOS-SDK.git", from: "1.3.0"),
16+
.package(name: "KommunicateChatUI-iOS-SDK", url: "https://github.com/Kommunicate-io/KommunicateChatUI-iOS-SDK.git", from: "1.3.1"),
1717
],
1818
targets: [
1919
.target(

Sources/Kommunicate/Classes/Extensions/NotificationCenter+Extension.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ extension Notification.Name {
4343
static let updateChannelName = Notification.Name("UPDATE_CHANNEL_NAME")
4444
static let updateUserDetails = Notification.Name("USER_DETAILS_UPDATE_CALL")
4545
static let newMessageNotification = Notification.Name(NEW_MESSAGE_NOTIFICATION)
46+
static let conversationDeletion = Notification.Name("CONVERSATION_DELETED")
4647
}

Sources/Kommunicate/Classes/FaqViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class FaqViewController: UIViewController, Localizable {
1717
self.url = url
1818
self.configuration = configuration
1919
super.init(nibName: nil, bundle: nil)
20-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.faqClick, data: ["faqUrl": url])
20+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.faqClick, data: ["faqUrl": url])
2121
}
2222

2323
@available(*, unavailable)

Sources/Kommunicate/Classes/KMConversationListViewController.swift

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
3030

3131
let channelService = ALChannelService()
3232
var searchController: UISearchController!
33-
var searchBar: CustomSearchBar!
33+
var searchBar: KMCustomSearchBar!
3434
lazy var resultVC = ALKSearchResultViewController(configuration: configuration)
3535

3636
public var dbService = ALMessageDBService()
@@ -158,6 +158,8 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
158158
NotificationCenter.default.addObserver(self, selector: #selector(updateUserDetails(notification:)), name: Notification.Name.updateUserDetails, object: nil)
159159

160160
NotificationCenter.default.addObserver(self, selector: #selector(updateChannelName(notification:)), name: Notification.Name.updateChannelName, object: nil)
161+
162+
NotificationCenter.default.addObserver(self, selector: #selector(conversationDeleted(notification: )), name: Notification.Name.conversationDeletion, object: nil)
161163

162164
converastionListNavBarItemToken = NotificationCenter.default.observe(name: NSNotification.Name(ALKNavigationItem.NSNotificationForConversationListNavigationTap), object: nil, queue: nil) { notification in
163165

@@ -346,6 +348,28 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
346348
print("update group detail")
347349
tableView.reloadData()
348350
}
351+
352+
@objc func conversationDeleted(notification : NSNotification) {
353+
guard let conversation = notification.object as? ALMessage else { return }
354+
deleteConversation(conversation: conversation)
355+
}
356+
357+
private func deleteConversation(conversation: ALMessage) {
358+
ALMessageService().deleteMessageThread(nil, orChannelKey: conversation.groupId, withCompletion: {
359+
_, error in
360+
guard error == nil else {
361+
print("Failed to delete the conversation: \(error.debugDescription)")
362+
return
363+
}
364+
})
365+
366+
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: {
367+
let channelDbService = ALChannelDBService()
368+
channelDbService.deleteChannel(conversation.groupId)
369+
self.viewModel.remove(message: conversation)
370+
self.tableView.reloadData()
371+
})
372+
}
349373

350374
override public func removeObserver() {
351375
if alMqttConversationService != nil {
@@ -396,7 +420,7 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
396420
func setupSearchController() {
397421
searchController = resultVC.setUpSearchViewController()
398422
searchController.searchBar.delegate = self
399-
searchBar = CustomSearchBar(searchBar: searchController.searchBar)
423+
searchBar = KMCustomSearchBar(searchBar: searchController.searchBar)
400424
definesPresentationContext = true
401425
}
402426

@@ -451,7 +475,7 @@ public class KMConversationListViewController: ALKBaseViewController, Localizabl
451475
}
452476

453477
@objc func customBackAction() {
454-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.conversationListBackPress, data: nil)
478+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.conversationListBackPress, data: nil)
455479
guard let nav = navigationController else { return }
456480
let poppedVC = nav.popViewController(animated: true)
457481
if poppedVC == nil {

Sources/Kommunicate/Classes/KMConversationViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ open class KMConversationViewController: ALKConversationViewController, KMUpdate
159159

160160
override open func newMessagesAdded() {
161161
super.newMessagesAdded()
162-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.messageReceive, data: nil)
162+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.messageReceive, data: nil)
163163
// Hide away message view whenever a new message comes.
164164
// Make sure the message is not from same user.
165165
guard !viewModel.messageModels.isEmpty else { return }
@@ -513,7 +513,7 @@ open class KMConversationViewController: ALKConversationViewController, KMUpdate
513513
self?.awayMessageView.isHidden = false
514514

515515
if let channelId = weakSelf.viewModel.channelKey {
516-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.restartConversationClick, data: ["conversationId":channelId])
516+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.restartConversationClick, data: ["conversationId":channelId])
517517
}
518518

519519
guard let zendeskAcckountKey = ALApplozicSettings.getZendeskSdkAccountKey(),
@@ -676,7 +676,7 @@ open class KMConversationViewController: ALKConversationViewController, KMUpdate
676676

677677
extension KMConversationViewController: NavigationBarCallbacks {
678678
func backButtonPressed() {
679-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.conversationBackPress, data: nil)
679+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.conversationBackPress, data: nil)
680680
view.endEditing(true)
681681
let popVC = navigationController?.popViewController(animated: true)
682682
if popVC == nil {
@@ -726,7 +726,7 @@ extension KMConversationViewController {
726726
}
727727
ratingVC.feedbackSubmitted = { [weak self] feedback in
728728
print("feedback submitted with rating: \(feedback.rating)")
729-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.submitRatingClick, data: ["rating": feedback.rating.rawValue,"comment":feedback.comment ?? "","conversationId": self?.viewModel.channelKey])
729+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.submitRatingClick, data: ["rating": feedback.rating.rawValue,"comment":feedback.comment ?? "","conversationId": self?.viewModel.channelKey])
730730
self?.hideRatingView()
731731
self?.submitFeedback(feedback: feedback)
732732
}

Sources/Kommunicate/Classes/Kommunicate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ open class Kommunicate: NSObject, Localizable {
383383
completion(.failure(KMConversationError.api(response.error)))
384384
return
385385
}
386-
KMCustomEventHandler.shared.publish(triggeredEvent: CustomEvent.newConversation, data: ["conversationId": conversationId])
386+
KMCustomEventHandler.shared.publish(triggeredEvent: KMCustomEvent.newConversation, data: ["conversationId": conversationId])
387387
completion(.success(conversationId))
388388
}
389389
})
@@ -1214,7 +1214,7 @@ open class Kommunicate: NSObject, Localizable {
12141214
- events: list of events to subscribe.
12151215
- callback: ALKCustomEventCallback to send subscribed event's data
12161216
*/
1217-
public static func subscribeCustomEvents(events: [CustomEvent], callback: ALKCustomEventCallback) {
1217+
public static func subscribeCustomEvents(events: [KMCustomEvent], callback: ALKCustomEventCallback) {
12181218
KMCustomEventHandler.shared.setSubscribedEvents(eventsList: events, eventDelegate: callback)
12191219
}
12201220

0 commit comments

Comments
 (0)