|
@@ -838,20 +838,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
|
|
|
if ViewController.listPullFB.count != 0 && ViewController.listPullFB.count > 2 {
|
|
|
let package_id = ViewController.listPullFB[2].split(separator: "|")[0]
|
|
|
var app_id = ""
|
|
|
- if ViewController.listPullFB[2].split(separator: "|").count > 1 {
|
|
|
- app_id = String(ViewController.listPullFB[2].split(separator: "|")[1])
|
|
|
- }
|
|
|
if package_id.contains("_fb") {
|
|
|
- let indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(where: { $0.contains("fb") }) ?? 0]
|
|
|
+ let indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
if indexTap == 99 {
|
|
|
openTabPost()
|
|
|
} else {
|
|
|
- if indexTap == 2 {
|
|
|
- let url = package_id.components(separatedBy: "_")[2]
|
|
|
- Nexilis.buttonClicked(index: indexTap, id: url)
|
|
|
- } else {
|
|
|
- Nexilis.buttonClicked(index: indexTap)
|
|
|
- }
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
}
|
|
|
} else {
|
|
|
if !app_id.isEmpty {
|
|
@@ -873,20 +870,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
|
|
|
if ViewController.listPullFB.count != 0 && ViewController.listPullFB.count > 4 {
|
|
|
let package_id = ViewController.listPullFB[4].split(separator: "|")[0]
|
|
|
var app_id = ""
|
|
|
- if ViewController.listPullFB[4].split(separator: "|").count > 1 {
|
|
|
- app_id = String(ViewController.listPullFB[4].split(separator: "|")[1])
|
|
|
- }
|
|
|
if package_id.contains("_fb") {
|
|
|
- let indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(where: { $0.contains("fb") }) ?? 0]
|
|
|
+ let indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
if indexTap == 99 {
|
|
|
openTabPost()
|
|
|
} else {
|
|
|
- if indexTap == 2 {
|
|
|
- let url = package_id.components(separatedBy: "_")[2]
|
|
|
- Nexilis.buttonClicked(index: indexTap, id: url)
|
|
|
- } else {
|
|
|
- Nexilis.buttonClicked(index: indexTap)
|
|
|
- }
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
}
|
|
|
} else {
|
|
|
if !app_id.isEmpty {
|
|
@@ -908,20 +902,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
|
|
|
if ViewController.listPullFB.count != 0 && ViewController.listPullFB.count > 1 {
|
|
|
let package_id = ViewController.listPullFB[1].split(separator: "|")[0]
|
|
|
var app_id = ""
|
|
|
- if ViewController.listPullFB[1].split(separator: "|").count > 1 {
|
|
|
- app_id = String(ViewController.listPullFB[1].split(separator: "|")[1])
|
|
|
- }
|
|
|
if package_id.contains("_fb") {
|
|
|
- let indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(where: { $0.contains("fb") }) ?? 0]
|
|
|
+ let indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
if indexTap == 99 {
|
|
|
openTabPost()
|
|
|
} else {
|
|
|
- if indexTap == 2 {
|
|
|
- let url = package_id.components(separatedBy: "_")[2]
|
|
|
- Nexilis.buttonClicked(index: indexTap, id: url)
|
|
|
- } else {
|
|
|
- Nexilis.buttonClicked(index: indexTap)
|
|
|
- }
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
}
|
|
|
} else {
|
|
|
if !app_id.isEmpty {
|
|
@@ -945,20 +936,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
|
|
|
if ViewController.listPullFB.count != 0 && ViewController.listPullFB.count > 0 {
|
|
|
let package_id = ViewController.listPullFB[0].split(separator: "|")[0]
|
|
|
var app_id = ""
|
|
|
- if ViewController.listPullFB[0].split(separator: "|").count > 1 {
|
|
|
- app_id = String(ViewController.listPullFB[0].split(separator: "|")[1])
|
|
|
- }
|
|
|
if package_id.contains("_fb") {
|
|
|
- let indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(where: { $0.contains("fb") }) ?? 0]
|
|
|
+ let indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
if indexTap == 99 {
|
|
|
openTabPost()
|
|
|
} else {
|
|
|
- if indexTap == 2 {
|
|
|
- let url = package_id.components(separatedBy: "_")[2]
|
|
|
- Nexilis.buttonClicked(index: indexTap, id: url)
|
|
|
- } else {
|
|
|
- Nexilis.buttonClicked(index: indexTap)
|
|
|
- }
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
}
|
|
|
} else {
|
|
|
if !app_id.isEmpty {
|
|
@@ -979,20 +967,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
|
|
|
if ViewController.listPullFB.count != 0 && ViewController.listPullFB.count > 3 {
|
|
|
let package_id = ViewController.listPullFB[3].split(separator: "|")[0]
|
|
|
var app_id = ""
|
|
|
- if ViewController.listPullFB[3].split(separator: "|").count > 1 {
|
|
|
- app_id = String(ViewController.listPullFB[3].split(separator: "|")[1])
|
|
|
- }
|
|
|
if package_id.contains("_fb") {
|
|
|
- let indexTap = Int(String(package_id.split(separator: "_")[1]).substring(from: 2, to: 2))!
|
|
|
+ let listSplit = package_id.split(separator: "_", maxSplits: 1)
|
|
|
+ let numIdx = listSplit[listSplit.firstIndex(where: { $0.contains("fb") }) ?? 0]
|
|
|
+ let indexTap = Int(String(numIdx).substring(from: 2, to: numIdx.count))!
|
|
|
+ if listSplit.count == 2 {
|
|
|
+ app_id = String(listSplit[1])
|
|
|
+ }
|
|
|
if indexTap == 99 {
|
|
|
openTabPost()
|
|
|
} else {
|
|
|
- if indexTap == 2 {
|
|
|
- let url = package_id.components(separatedBy: "_")[2]
|
|
|
- Nexilis.buttonClicked(index: indexTap, id: url)
|
|
|
- } else {
|
|
|
- Nexilis.buttonClicked(index: indexTap)
|
|
|
- }
|
|
|
+ Nexilis.buttonClicked(index: indexTap, id: app_id)
|
|
|
}
|
|
|
} else {
|
|
|
if !app_id.isEmpty {
|