From b2073a5d59b9d945d2962967ad4feab722cdc311 Mon Sep 17 00:00:00 2001 From: QSD_faris Date: Fri, 26 Jan 2024 16:40:57 +0100 Subject: [PATCH] update example project --- .../SwiftExample.xcodeproj/project.pbxproj | 16 +-- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../messenger.imageset/Contents.json | 21 +++ .../messenger.imageset/messenger-2.png | Bin 0 -> 7440 bytes .../SwiftExample/Base.lproj/Main.storyboard | 16 +-- .../SwiftExample/ViewController.swift | 23 ++- .../SwiftExample/SwiftExample/error_page.html | 131 ++++++++++++++++++ 7 files changed, 179 insertions(+), 32 deletions(-) create mode 100644 Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/Contents.json create mode 100644 Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/messenger-2.png create mode 100644 Examples/SwiftExample/SwiftExample/error_page.html diff --git a/Examples/SwiftExample/SwiftExample.xcodeproj/project.pbxproj b/Examples/SwiftExample/SwiftExample.xcodeproj/project.pbxproj index 434a789..241f68b 100644 --- a/Examples/SwiftExample/SwiftExample.xcodeproj/project.pbxproj +++ b/Examples/SwiftExample/SwiftExample.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 5E19F59B2B477AE400E37F55 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E19F5992B477AE400E37F55 /* Main.storyboard */; }; 5E19F59D2B477AE400E37F55 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E19F59C2B477AE400E37F55 /* Assets.xcassets */; }; 5E19F5A02B477AE400E37F55 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E19F59E2B477AE400E37F55 /* LaunchScreen.storyboard */; }; - 5EA7B6F02B549B6200C9B3AC /* messenger-sdk-ios in Frameworks */ = {isa = PBXBuildFile; productRef = 5EA7B6EF2B549B6200C9B3AC /* messenger-sdk-ios */; }; + 5ED8E9D92B64072C0007CD34 /* messenger-sdk-ios in Frameworks */ = {isa = PBXBuildFile; productRef = 5ED8E9D82B64072C0007CD34 /* messenger-sdk-ios */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -45,7 +45,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5EA7B6F02B549B6200C9B3AC /* messenger-sdk-ios in Frameworks */, + 5ED8E9D92B64072C0007CD34 /* messenger-sdk-ios in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,7 +100,7 @@ ); name = SwiftExample; packageProductDependencies = ( - 5EA7B6EF2B549B6200C9B3AC /* messenger-sdk-ios */, + 5ED8E9D82B64072C0007CD34 /* messenger-sdk-ios */, ); productName = SwiftExample; productReference = 5E19F5902B477AE400E37F55 /* SwiftExample.app */; @@ -131,7 +131,7 @@ ); mainGroup = 5E19F5872B477AE400E37F55; packageReferences = ( - 5EA7B6EE2B549B6200C9B3AC /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */, + 5ED8E9D72B64072C0007CD34 /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */, ); productRefGroup = 5E19F5912B477AE400E37F55 /* Products */; projectDirPath = ""; @@ -384,20 +384,20 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 5EA7B6EE2B549B6200C9B3AC /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */ = { + 5ED8E9D72B64072C0007CD34 /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/deskpro/messenger-sdk-ios.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.0.4; + minimumVersion = 0.0.5; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 5EA7B6EF2B549B6200C9B3AC /* messenger-sdk-ios */ = { + 5ED8E9D82B64072C0007CD34 /* messenger-sdk-ios */ = { isa = XCSwiftPackageProductDependency; - package = 5EA7B6EE2B549B6200C9B3AC /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */; + package = 5ED8E9D72B64072C0007CD34 /* XCRemoteSwiftPackageReference "messenger-sdk-ios" */; productName = "messenger-sdk-ios"; }; /* End XCSwiftPackageProductDependency section */ diff --git a/Examples/SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c325792..e293daa 100644 --- a/Examples/SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/SwiftExample/SwiftExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/deskpro/messenger-sdk-ios.git", "state" : { - "revision" : "acd128d826940bf1ef4fbd551cc5afd5369196b9", - "version" : "0.0.4" + "revision" : "819692434d517e650d8c0b779760b6d5b764a45e", + "version" : "0.0.5" } } ], diff --git a/Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/Contents.json b/Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/Contents.json new file mode 100644 index 0000000..be4d3f4 --- /dev/null +++ b/Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "messenger-2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/messenger-2.png b/Examples/SwiftExample/SwiftExample/Assets.xcassets/messenger.imageset/messenger-2.png new file mode 100644 index 0000000000000000000000000000000000000000..deebb4344c8a04eaad721daedac1e5d638514895 GIT binary patch literal 7440 zcmV+r9q;0aP)O>@9LbEq`yQ&Y0i%$%nbXRMt42m})mF-1To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{4;lTd_^CF;Y zl4S{!fHPkdq!BYVCHl+grztP-V*_wFa+xGle)^=zO5}#*@mSvd#Bnm=2bhNA=c6BR z6mT~drC6@40wx2eAR*pHg1MRS11=|%k$@3xx&dEB5=z=OA-^m|BK1xLHmaq= zB!|JZz#*g{6KQa+CA~gy(MY8z}Kvq`$vj6r$jw*X1 zlSX%>)K)9vuq%*Ey-moHeJK)Y_aCIl$y{VLG8b|F79YkL>7_rC-s^SBUxt2)e0AT! zyViyg1ERbF$j5NtOTZ|kO3Oebt4mj;HvD{K8TuBo)PD|niy4NIhyMb*8!+NSEX(Eq O0000 + @@ -34,33 +35,18 @@ - - - - diff --git a/Examples/SwiftExample/SwiftExample/ViewController.swift b/Examples/SwiftExample/SwiftExample/ViewController.swift index b7f092b..3803dba 100644 --- a/Examples/SwiftExample/SwiftExample/ViewController.swift +++ b/Examples/SwiftExample/SwiftExample/ViewController.swift @@ -10,12 +10,10 @@ import DeskproFramework class ViewController: UIViewController { - @IBOutlet weak var openBtn: UIButton! @IBOutlet weak var testBtn: UIButton! @IBOutlet weak var testLbl: UILabel! - //let messengerConfig = MessengerConfig(appUrl: "http://178.62.74.147:3001/d/", appId: "B0ED0B34-8507-4248-8738-0B0D80A6F7E9") - let messengerConfig = MessengerConfig(appUrl: "https://dev-pr-12670.earthly.deskprodemo.com/deskpro-messenger/deskpro/1/d/", appId: "") + let messengerConfig = MessengerConfig(appUrl: "https://dev-pr-12730.earthly.deskprodemo.com/deskpro-messenger/deskpro/1/d/", appId: "1") var messenger: DeskPro? @@ -23,14 +21,25 @@ class ViewController: UIViewController { super.viewDidLoad() messenger = DeskPro(messengerConfig: messengerConfig, containingViewController: self) + + setupLauncherButton() + } + + @IBAction func testTapped(_ sender: Any) { + testLbl.text = messenger?.test() } - @IBAction func openTapped(_ sender: Any) { - messenger?.present().show() + private func setupLauncherButton() { + let floatingBtn = DeskproButton() + floatingBtn.setColor(.systemBlue) + floatingBtn.setImage(named: "messenger", color: .white) + floatingBtn.addTarget(self, action: #selector(floatingBtnnTapped), for: .touchUpInside) + self.view.addSubview(floatingBtn) + floatingBtn.setPosition(.bottomRight, inView: self.view) } - @IBAction func testTapped(_ sender: Any) { - testLbl.text = messenger?.test() + @objc private func floatingBtnnTapped() { + messenger?.present().show() } } diff --git a/Examples/SwiftExample/SwiftExample/error_page.html b/Examples/SwiftExample/SwiftExample/error_page.html new file mode 100644 index 0000000..c4662ad --- /dev/null +++ b/Examples/SwiftExample/SwiftExample/error_page.html @@ -0,0 +1,131 @@ + + + + + + + + +
+
+

Loading...

+
+
+ +
+

Something's gone wrong

+

Content could not be loaded

+ +
+ + +