You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
4.0 KiB

6 years ago
6 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // AboutGMEViewController.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 2/13/18.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class AboutGMEViewController: UIViewController {
  10. struct StringConstants {
  11. let descriptionText = "about_me_description_text".localized()
  12. let appVersionText = "app_version_text".localized()
  13. let followText = "follow_us_text".localized()
  14. let aboutGme = "about_gme_text".localized()
  15. }
  16. // language
  17. @IBOutlet weak var versionLabel: UILabel!
  18. @IBOutlet weak var descriptionLabel: UILabel!
  19. @IBOutlet weak var followUsTitleText: UILabel!
  20. @IBOutlet weak var versionTitleLabel: UILabel!
  21. let URLFacebookApp: String = "fb://profile/1129818613815224"
  22. let URLFacebookApp2: String = "fb://page/1129818613815224"
  23. let URLFacebookBrowser: String = "https://www.facebook.com/1129818613815224/"
  24. let URLLinkedInApp: String = "linkedin://company/gmeremit/"
  25. let URLLinkedInBrowser: String = "https://www.linkedin.com/company/gmeremit/"
  26. // var defaultCountries = ["Nepal", "Cambodia", "Philipinnes", "Sri Lanka", "Vietnam", "India", "Pakistan", "azerbaijan", "Bangladesh", "Belarus", "Georgia", "Indonesia", "Kazakhstan", "Kyrgyzstan", "Malaysia", "Moldova", "Mongolia", "Myanmar", "Russian Federation", "Singapore", "Tajikistan", "Thailand", "Uzbekistan"]
  27. // var defaultCountryCodes = ["np", "kh", "ph", "lk", "vn", "in", "pk", "az", "bd", "by", "ge", "id", "kz", "kg", "my", "md", "mn", "mm", "ru", "sg", "tj", "th", "uz", "en"]
  28. let FacebookUrls: [String: String] = [
  29. "np" : "https://www.facebook.com/gmenepal/",
  30. "kh" : "https://www.facebook.com/gmecambodia/",
  31. "lk" : "https://www.facebook.com/gmeremitsrilanka/",
  32. "vn" : "https://www.facebook.com/gmevietnam/",
  33. "ph" : "https://www.facebook.com/gmephilippines/",
  34. "bd" : "https://www.facebook.com/gmebangladesh/",
  35. "id" : "https://www.facebook.com/gmeindonesia/",
  36. "th" : "https://www.facebook.com/gmethailand/",
  37. "mn" : "https://www.facebook.com/gmemongolia/",
  38. "uz" : "https://www.facebook.com/gmeuzbekistan/",
  39. "in" : "https://www.facebook.com/GMEindia/",
  40. "pk" : "https://www.facebook.com/gmepakistan/",
  41. "mm" : "https://www.facebook.com/gmemyanmar/"
  42. ]
  43. override func viewDidLoad() {
  44. super.viewDidLoad()
  45. self.versionLabel.text = Utility.getAppVersion()
  46. configureLanguage()
  47. }
  48. override func viewWillAppear(_ animated: Bool) {
  49. super.viewWillAppear(animated)
  50. self.setupNormalNavigation()
  51. self.navigationItem.title = StringConstants().aboutGme
  52. }
  53. override func didReceiveMemoryWarning() {
  54. super.didReceiveMemoryWarning()
  55. // Dispose of any resources that can be recreated.
  56. }
  57. func configureLanguage() {
  58. self.descriptionLabel.text = StringConstants().descriptionText
  59. self.followUsTitleText.text = StringConstants().followText
  60. self.versionTitleLabel.text = StringConstants().appVersionText
  61. }
  62. @IBAction func checkForUpdate(_ sender: Any) {
  63. //
  64. }
  65. @IBAction func openLinkedIn(_ sender: Any) {
  66. // UIApplication.tryURL(urls: [self.URLLinkedInApp,
  67. // self.URLLinkedInBrowser
  68. // ])
  69. }
  70. @IBAction func openFacebook(_ sender: Any) {
  71. guard let nativeCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet) else {return}
  72. UIApplication.tryURL(url: self.FacebookUrls[nativeCountry.lowercased()] ?? "https://www.facebook.com/gmenepal/")
  73. }
  74. }
  75. extension UIApplication {
  76. class func tryURL(url: String) {
  77. let application = UIApplication.shared
  78. if let _url = URL(string: url), application.canOpenURL(_url) {
  79. if #available(iOS 10.0, *) {
  80. application.open(URL(string: url)!, options: [:], completionHandler: nil)
  81. } else {
  82. // Fallback on earlier versions
  83. }
  84. return
  85. }
  86. }
  87. }