From d6a76bdd1dd6085e2eabe1f8e7d20d26e20c39d9 Mon Sep 17 00:00:00 2001 From: Pran Kishore Date: Fri, 28 Jun 2024 23:48:10 +0530 Subject: [PATCH 1/4] fix probable crash --- .../Sources/Services/Location/LocationService.swift | 6 ++++-- animeal/AppDelegate.swift | 2 +- .../Auth/Modules/Login/LoginViewController.swift | 11 +++++++++++ .../Verification/VerificationViewController.swift | 12 ++++++++++++ .../Modules/Home/Main/View/HomeViewController.swift | 12 ++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Services/Sources/Services/Location/LocationService.swift b/Services/Sources/Services/Location/LocationService.swift index 2fc78c40..2a18b55f 100644 --- a/Services/Sources/Services/Location/LocationService.swift +++ b/Services/Sources/Services/Location/LocationService.swift @@ -80,8 +80,10 @@ extension LocationService: ApplicationDelegateService { _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any]? ) -> Bool { - locationManager.requestAuthorization(mode: .onlyInUse) {[weak self] status in - self?.logger.info("[LocationService] Current authorization status: \(status)") + DispatchQueue.global(qos: .userInitiated).async { [weak self] in + self?.locationManager.requestAuthorization(mode: .onlyInUse) {[weak self] status in + self?.logger.info("[LocationService] Current authorization status: \(status)") + } } return true } diff --git a/animeal/AppDelegate.swift b/animeal/AppDelegate.swift index 56e6a27f..20904dfa 100644 --- a/animeal/AppDelegate.swift +++ b/animeal/AppDelegate.swift @@ -95,7 +95,7 @@ private extension AppDelegate { try Amplify.add(plugin: AWSAPIPlugin(sessionFactory: AppDelegate.makeDefault())) try Amplify.configure() try Amplify.API.add(interceptor: UrlQueryPlusFixInterceptor(), for: "AdminQueries") - Amplify.Logging.logLevel = .verbose + Amplify.Logging.logLevel = .error logInfo("[APP] Amplify configured") } catch { logError("[APP] Failed to initialize Amplify with \(error)") diff --git a/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift b/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift index d54fe491..1b022ed1 100644 --- a/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift +++ b/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift @@ -10,6 +10,7 @@ import UIKit // SDK import UIComponents +import Services final class LoginViewController: UIViewController, LoginViewable { // MARK: - UI properties @@ -53,6 +54,16 @@ final class LoginViewController: UIViewController, LoginViewable { viewModel.load() } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + AppDelegate.shared.context.analyticsService.logEvent( + ScreenViewEvent( + screenName: AnalyticsScreen.screenForViewController(self).description, + trackablePolicy: .multipleTracking, + targets: [AnalyticsTargetType.firebase] + ) + ) + } // MARK: - State func applyOnboarding(_ onboardingSteps: [LoginViewOnboardingStep]) { onboardingView.configure( diff --git a/animeal/src/Flows/Auth/Modules/Verification/VerificationViewController.swift b/animeal/src/Flows/Auth/Modules/Verification/VerificationViewController.swift index 3afcbfc7..8730cde9 100644 --- a/animeal/src/Flows/Auth/Modules/Verification/VerificationViewController.swift +++ b/animeal/src/Flows/Auth/Modules/Verification/VerificationViewController.swift @@ -3,6 +3,7 @@ import UIKit // SDK import UIComponents +import Services final class VerificationViewController: BaseViewController, VerificationViewModelOutput { // MARK: - UI properties @@ -30,6 +31,17 @@ final class VerificationViewController: BaseViewController, VerificationViewMode bind() viewModel.load() } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + AppDelegate.shared.context.analyticsService.logEvent( + ScreenViewEvent( + screenName: AnalyticsScreen.screenForViewController(self).description, + trackablePolicy: .multipleTracking, + targets: [AnalyticsTargetType.firebase] + ) + ) + } override func handleKeyboardNotification(keyboardData: KeyboardData) { super.handleKeyboardNotification(keyboardData: keyboardData) diff --git a/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift b/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift index 434a7cb7..c382cb8e 100644 --- a/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift +++ b/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift @@ -3,6 +3,7 @@ import AVFoundation import Style import UIComponents import Common +import Services @_spi(Experimental) import MapboxMaps class HomeViewController: UIViewController { @@ -69,6 +70,17 @@ class HomeViewController: UIViewController { viewModel.updateSelectionIfNeeded(for: itemIdentifier) } } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + AppDelegate.shared.context.analyticsService.logEvent( + ScreenViewEvent( + screenName: AnalyticsScreen.screenForViewController(self).description, + trackablePolicy: .multipleTracking, + targets: [AnalyticsTargetType.firebase] + ) + ) + } } extension HomeViewController: HomeViewModelOutput { From 6e4eafa54aa24a55a0104312e53b958009d92b39 Mon Sep 17 00:00:00 2001 From: Pran Kishore Date: Fri, 28 Jun 2024 23:48:53 +0530 Subject: [PATCH 2/4] update build version --- animeal.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/animeal.xcodeproj/project.pbxproj b/animeal.xcodeproj/project.pbxproj index 782db9c5..aaed67d5 100644 --- a/animeal.xcodeproj/project.pbxproj +++ b/animeal.xcodeproj/project.pbxproj @@ -3084,7 +3084,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development: Pran Kishore (CM95PV92ZY)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240505; + CURRENT_PROJECT_VERSION = 20240628; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; @@ -3127,7 +3127,7 @@ CODE_SIGN_IDENTITY = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240505; + CURRENT_PROJECT_VERSION = 20240628; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; GENERATE_INFOPLIST_FILE = YES; From 2a9b255297fd283b26028752cb22f886d88191c7 Mon Sep 17 00:00:00 2001 From: Pran Kishore Date: Wed, 3 Jul 2024 22:36:20 +0530 Subject: [PATCH 3/4] disable tapping on phone number code re upload a new version --- animeal.xcodeproj/project.pbxproj | 4 ++-- .../Auth/Modules/CustomAuth/CustomAuthViewController.swift | 2 ++ animeal/src/Flows/Profile/ProfileViewController.swift | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/animeal.xcodeproj/project.pbxproj b/animeal.xcodeproj/project.pbxproj index aaed67d5..cd769607 100644 --- a/animeal.xcodeproj/project.pbxproj +++ b/animeal.xcodeproj/project.pbxproj @@ -3084,7 +3084,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development: Pran Kishore (CM95PV92ZY)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240628; + CURRENT_PROJECT_VERSION = 20240703; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; @@ -3127,7 +3127,7 @@ CODE_SIGN_IDENTITY = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240628; + CURRENT_PROJECT_VERSION = 20240703; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; GENERATE_INFOPLIST_FILE = YES; diff --git a/animeal/src/Flows/Auth/Modules/CustomAuth/CustomAuthViewController.swift b/animeal/src/Flows/Auth/Modules/CustomAuth/CustomAuthViewController.swift index 65ccdf63..2ce02314 100644 --- a/animeal/src/Flows/Auth/Modules/CustomAuth/CustomAuthViewController.swift +++ b/animeal/src/Flows/Auth/Modules/CustomAuth/CustomAuthViewController.swift @@ -132,12 +132,14 @@ private extension CustomAuthViewController { case .phone: let inputView = PhoneInputView() inputView.configure(item.phoneModel) + #if DEBUG inputView.codeWasTapped = { [weak self] _ in self?.view.endEditing(true) self?.viewModel.handleActionEvent( CustomAuthViewActionEvent.itemWasTapped(item.identifier) ) } + #endif inputView.didBeginEditing = { [weak self] textInput in guard let self = self else { return } let text = textInput.text diff --git a/animeal/src/Flows/Profile/ProfileViewController.swift b/animeal/src/Flows/Profile/ProfileViewController.swift index 01074977..eb567553 100644 --- a/animeal/src/Flows/Profile/ProfileViewController.swift +++ b/animeal/src/Flows/Profile/ProfileViewController.swift @@ -161,11 +161,13 @@ private extension ProfileViewController { guard let model = (item as? ProfileTextFieldViewItem)?.phoneModel else { return } let inputView = PhoneInputView() inputView.configure(model) + #if DEBUG inputView.codeWasTapped = { [weak self] _ in self?.viewModel.handleActionEvent( ProfileViewActionEvent.itemWasTapped(item.identifier) ) } + #endif inputView.didBeginEditing = { [weak self] textInput in guard let self = self else { return } let text = textInput.text From 28531c0c24f248669cd27688c71aac44fff154f0 Mon Sep 17 00:00:00 2001 From: Pran Kishore Date: Thu, 4 Jul 2024 22:23:51 +0530 Subject: [PATCH 4/4] hide scroll view in login view controller --- .../Components/Custom/Onboarding/OnboardingView.swift | 1 + animeal.xcodeproj/project.pbxproj | 4 ++-- .../src/Flows/Auth/Modules/Login/LoginViewController.swift | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/UIComponents/Sources/UIComponents/Components/Custom/Onboarding/OnboardingView.swift b/UIComponents/Sources/UIComponents/Components/Custom/Onboarding/OnboardingView.swift index b980745a..cce4ef28 100644 --- a/UIComponents/Sources/UIComponents/Components/Custom/Onboarding/OnboardingView.swift +++ b/UIComponents/Sources/UIComponents/Components/Custom/Onboarding/OnboardingView.swift @@ -79,6 +79,7 @@ public final class OnboardingView: UIView { numberOfSteps: model.steps.count ) ) + stepperView.isHidden = true } // MARK: - Setup diff --git a/animeal.xcodeproj/project.pbxproj b/animeal.xcodeproj/project.pbxproj index cd769607..5d6d4993 100644 --- a/animeal.xcodeproj/project.pbxproj +++ b/animeal.xcodeproj/project.pbxproj @@ -3084,7 +3084,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development: Pran Kishore (CM95PV92ZY)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240703; + CURRENT_PROJECT_VERSION = 20240704; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; @@ -3127,7 +3127,7 @@ CODE_SIGN_IDENTITY = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution: Animals Project, NCLE (2JSLPH439W)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20240703; + CURRENT_PROJECT_VERSION = 20240704; DEVELOPMENT_TEAM = 2JSLPH439W; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 2JSLPH439W; GENERATE_INFOPLIST_FILE = YES; diff --git a/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift b/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift index 1b022ed1..3b277cb2 100644 --- a/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift +++ b/animeal/src/Flows/Auth/Modules/Login/LoginViewController.swift @@ -90,6 +90,7 @@ final class LoginViewController: UIViewController, LoginViewable { ).isActive = true onboardingView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true onboardingView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + onboardingView.isUserInteractionEnabled = false view.addSubview(buttonsView) buttonsView.topAnchor.constraint(equalTo: onboardingView.bottomAnchor).isActive = true