|
@@ -220,6 +220,7 @@ public class FloatingButton: UIView {
|
|
|
private func checkDelayAnimation() {
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: { [self] in
|
|
|
if !isShow {
|
|
|
+ animationTimer.invalidate()
|
|
|
animationTimer = Timer.scheduledTimer(timeInterval: 0.001, target: self, selector: #selector(runAnimation), userInfo: nil, repeats: true)
|
|
|
}
|
|
|
})
|
|
@@ -297,7 +298,9 @@ public class FloatingButton: UIView {
|
|
|
let data = try? Data(contentsOf: URL(string: "https://nexilis.io/dashboardv2/uploads/fb_icon/\(icon)")!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
|
|
|
DispatchQueue.main.async {
|
|
|
if data != nil {
|
|
|
- newButton.setImage(UIImage(data: data!), for: .normal)
|
|
|
+ if let image = UIImage(data: data!) {
|
|
|
+ newButton.setImage(image, for: .normal)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -552,36 +555,17 @@ public class FloatingButton: UIView {
|
|
|
var app_id = sender.accessibilityIdentifier!
|
|
|
var indexTap = 0
|
|
|
if package_id.contains("_fb"){
|
|
|
- let numIdx = package_id.split(separator: "_")[1]
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(of: "fb") ?? 0]
|
|
|
indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
- }
|
|
|
- if indexTap == 2 {
|
|
|
- app_id = package_id.components(separatedBy: "_")[2]
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
}
|
|
|
Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
hideButton()
|
|
|
}
|
|
|
|
|
|
- @objc func fb1Tap() {
|
|
|
- APIS.openContactCenter()
|
|
|
- hideButton()
|
|
|
- }
|
|
|
-
|
|
|
- @objc func fb2Tap() {
|
|
|
- APIS.startConversation()
|
|
|
- hideButton()
|
|
|
- }
|
|
|
-
|
|
|
- @objc func fb3Tap() {
|
|
|
- APIS.openCall()
|
|
|
- hideButton()
|
|
|
- }
|
|
|
-
|
|
|
- @objc func fb4Tap() {
|
|
|
- APIS.openStreaming()
|
|
|
- hideButton()
|
|
|
- }
|
|
|
-
|
|
|
@objc func qmeraLongPress(gestureRecognizer: UILongPressGestureRecognizer) {
|
|
|
if gestureRecognizer.state == .began {
|
|
|
if mySettingDelegate != nil {
|