Browse Source

based on native country

pull/1/head
james 5 years ago
parent
commit
5d23d61733
  1. 11
      GMERemittance/SideMenu/AboutGMEViewController.swift
  2. 6
      GMERemittance/Utility/HotLine/Application Logic/Interactor/HotLineInteractor.swift

11
GMERemittance/SideMenu/AboutGMEViewController.swift

@ -58,8 +58,6 @@ class AboutGMEViewController: UIViewController {
configureLanguage() configureLanguage()
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
self.setupNormalNavigation() self.setupNormalNavigation()
@ -88,7 +86,14 @@ class AboutGMEViewController: UIViewController {
} }
@IBAction func openFacebook(_ sender: Any) { @IBAction func openFacebook(_ sender: Any) {
guard let nativeCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet) else {return}
// Based on selected Language
// guard let nativeCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet) else {return}
//
// Based on native country
guard let nativeCountry = UserDefaults.standard.string(forKey: UserKeys.countryCode)?.lowercased() else {
return
}
UIApplication.tryURL(url: self.FacebookUrls[nativeCountry.lowercased()] ?? "https://www.facebook.com/gmenepal/") UIApplication.tryURL(url: self.FacebookUrls[nativeCountry.lowercased()] ?? "https://www.facebook.com/gmenepal/")
} }

6
GMERemittance/Utility/HotLine/Application Logic/Interactor/HotLineInteractor.swift

@ -29,7 +29,11 @@ extension HotLineInteractor: HotLineInteractorInput {
func fetchHotLines() { func fetchHotLines() {
service.fetchHotLines( service.fetchHotLines(
success: { success: {
let userCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet)
// Base selected Language
// let userCountry = UserDefaults.standard.string(forKey: AppConstants.firstTimeLanguageIsSet)
// Base Native Country as lowercased
let userCountry = UserDefaults.standard.string(forKey: UserKeys.countryCode)?.lowercased()
guard guard
let userHotLine = $0?.filter({ $0.countryCode == userCountry }), let userHotLine = $0?.filter({ $0.countryCode == userCountry }),

Loading…
Cancel
Save