Skip to content

Commit

Permalink
Fixed close and minimise callback issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KartheekPa-Kore committed Sep 25, 2024
1 parent ba864d4 commit 1aa5087
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Examples/CocoapodsDemo/KoreBotSDKDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ViewController: UIViewController {
// MARK: Show Bot window
botConnect.show()

// MARK: Close Or Minimize event
// MARK: Close Or Minimize Callbacks
botConnect.closeOrMinimizeEvent = { (eventDic) in
if let dic = eventDic {
print(dic)
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Enable the webhook channel - This should be either true (in case of Webhook conn
#### 1. Setup KoreBotSDK
###### a. Using SPM
dependencies: [
.package(url: "https://github.com/Koredotcom/iOS-kore-sdk", .upToNextMajor(from: "1.0.9"))
.package(url: "https://github.com/Koredotcom/iOS-kore-sdk", .upToNextMajor(from: "2.0.0"))
]
###### b. In your ViewController add below lines
1. import KoreBotSDK
Expand All @@ -119,6 +119,13 @@ Enable the webhook channel - This should be either true (in case of Webhook conn
// MARK: Show Bot window
botConnect.show()
// MARK: Close Or Minimize Callbacks
botConnect.closeOrMinimizeEvent = { (eventDic) in
if let dic = eventDic {
print(dic)
}
}
###### c. Add below permissions in info.plist
Privacy - Camera Usage Description --- Allow access to camera.
Privacy - Microphone Usage Description --- Allow access to microphone.
Expand Down Expand Up @@ -164,6 +171,13 @@ Enable the webhook channel - This should be either true (in case of Webhook conn
// MARK: Show Bot window
botConnect.show()
// MARK: Close Or Minimize Callbacks
botConnect.closeOrMinimizeEvent = { (eventDic) in
if let dic = eventDic {
print(dic)
}
}
###### c. Add below permissions in info.plist
Privacy - Camera Usage Description --- Allow access to camera.
Privacy - Microphone Usage Description --- Allow access to microphone.
Expand Down Expand Up @@ -204,6 +218,13 @@ Enable the webhook channel - This should be either true (in case of Webhook conn
// MARK: Show Bot window
botConnect.show()
// MARK: Close Or Minimize Callbacks
botConnect.closeOrMinimizeEvent = { (eventDic) in
if let dic = eventDic {
print(dic)
}
}

License
----
Expand Down
4 changes: 3 additions & 1 deletion Sources/KoreBotSDK/AppKit/Common/BotConnect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ open class BotConnect: NSObject {

botViewController.closeAndMinimizeEvent = { [weak self] (Dic) in
if let dic = Dic {
self?.closeOrMinimizeEvent(dic)
if self?.closeOrMinimizeEvent != nil{
self?.closeOrMinimizeEvent(dic)
}
}
}
}
Expand Down

0 comments on commit 1aa5087

Please sign in to comment.