Skip to content

Commit

Permalink
improve swift example
Browse files Browse the repository at this point in the history
  • Loading branch information
QSD_faris committed Jan 8, 2024
1 parent 8be6734 commit ea55ccb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
repositoryURL = "https://github.com/deskpro/messenger-sdk-ios.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.0.1;
minimumVersion = 0.0.2;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/deskpro/messenger-sdk-ios.git",
"state" : {
"revision" : "657f73a507bd72e17ce340dd2e8b68f24d2889c6",
"version" : "0.0.1"
"revision" : "8be673468b716ef7ad53c6c465cffde7022df348",
"version" : "0.0.2"
}
}
],
Expand Down
18 changes: 2 additions & 16 deletions Examples/SwiftExample/SwiftExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ class ViewController: UIViewController {
@IBOutlet weak var testLbl: UILabel!
@IBOutlet weak var openBtn: UIButton!

let deskproUrlString = "https://www.deskpro.com"
let messengerUrlString = "http://178.62.74.147:3001/d/B0ED0B34-8507-4248-8738-0B0D80A6F7E9/"
let messengerConfig = MessengerConfig(appUrl: "http://178.62.74.147:3001/d/", appId: "B0ED0B34-8507-4248-8738-0B0D80A6F7E9")
var messenger: DeskPro?

override func viewDidLoad() {
super.viewDidLoad()

messenger = DeskPro(messengerConfig: messengerConfig)

messenger?.present().show()
messenger = DeskPro(messengerConfig: messengerConfig, containingViewController: self)
}

@IBAction func testTapped(_ sender: Any) {
Expand All @@ -34,17 +30,7 @@ class ViewController: UIViewController {
}

@IBAction func openTapped(_ sender: Any) {
openWebView(urlString: messengerUrlString)
}

private func openWebView(urlString: String) {
let customWebView = CustomWebView()

if let url = URL(string: urlString) {
customWebView.configureURL(url)
}

present(customWebView, animated: true)
messenger?.present().show()
}
}

0 comments on commit ea55ccb

Please sign in to comment.