Browse Source

based on native country

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

13
GMERemittance/SideMenu/AboutGMEViewController.swift

@ -57,9 +57,7 @@ class AboutGMEViewController: UIViewController {
self.versionLabel.text = Utility.getAppVersion()
configureLanguage()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setupNormalNavigation()
@ -88,7 +86,14 @@ class AboutGMEViewController: UIViewController {
}
@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/")
}

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

@ -29,8 +29,12 @@ extension HotLineInteractor: HotLineInteractorInput {
func fetchHotLines() {
service.fetchHotLines(
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
let userHotLine = $0?.filter({ $0.countryCode == userCountry }),
let anotherHotLines = $0?.filter ({ $0.countryCode != userCountry })

Loading…
Cancel
Save