From 7920a89ab0c127b6ef7b16d4c158dea7774dc6a6 Mon Sep 17 00:00:00 2001 From: Mikaela Caron Date: Fri, 17 Nov 2023 14:31:30 -0500 Subject: [PATCH] Make Paywall Todos and Add Crashlytics (#265) --- .../project.pbxproj | 34 ++++++++++++++++++- .../Dashboard/Views/DashboardView.swift | 4 +++ .../Shared/Odometer/Views/OdometerView.swift | 2 ++ .../Shared/Settings/Views/SettingsView.swift | 7 +++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Basic-Car-Maintenance.xcodeproj/project.pbxproj b/Basic-Car-Maintenance.xcodeproj/project.pbxproj index 2bcd6003..e176f9ec 100644 --- a/Basic-Car-Maintenance.xcodeproj/project.pbxproj +++ b/Basic-Car-Maintenance.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ E58499682ACDDA9A00634660 /* ContributorsProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E58499672ACDDA9A00634660 /* ContributorsProfileView.swift */; }; E584996A2ACDDAFF00634660 /* Contributor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E58499692ACDDAFF00634660 /* Contributor.swift */; }; FF09FC912AB6FF44006BE61A /* AuthenticationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF09FC902AB6FF44006BE61A /* AuthenticationView.swift */; }; + FF153AFF2B07C3E000D0BA30 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = FF153AFE2B07C3E000D0BA30 /* FirebaseCrashlytics */; }; FF218EF62B00865F0025A533 /* AnalyticsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF218EF52B00865F0025A533 /* AnalyticsService.swift */; }; FF3DDF522AA4D28F009D91C4 /* DashboardViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3DDF512AA4D28F009D91C4 /* DashboardViewModel.swift */; }; FF4E82BE2AD39863004949AF /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = FF4E82BD2AD39863004949AF /* FirebaseRemoteConfig */; }; @@ -175,6 +176,7 @@ FFC8CDAB2AA3867A00D129A6 /* FirebaseAuth in Frameworks */, FFC8CDA72AA3867A00D129A6 /* FirebaseAnalytics in Frameworks */, FF4E82C02AD39863004949AF /* FirebaseRemoteConfigSwift in Frameworks */, + FF153AFF2B07C3E000D0BA30 /* FirebaseCrashlytics in Frameworks */, FF4E82C22AD39863004949AF /* FirebaseStorage in Frameworks */, FFC8CDB32AA4226900D129A6 /* AdSupport.framework in Frameworks */, ); @@ -490,6 +492,7 @@ FF5D13A12A86C2D600BC9BD6 /* Resources */, FF748B5A2AB34A61004748A5 /* SwiftLintScript */, FFDADF8F2ACD35A200DDEF79 /* Embed Foundation Extensions */, + FF50DDC22B07DF0C00E87362 /* ShellScript */, ); buildRules = ( ); @@ -506,6 +509,7 @@ FF4E82BD2AD39863004949AF /* FirebaseRemoteConfig */, FF4E82BF2AD39863004949AF /* FirebaseRemoteConfigSwift */, FF4E82C12AD39863004949AF /* FirebaseStorage */, + FF153AFE2B07C3E000D0BA30 /* FirebaseCrashlytics */, ); productName = "Basic-Car-Maintenance"; productReference = FF5D13A32A86C2D600BC9BD6 /* Basic-Car-Maintenance.app */; @@ -661,6 +665,29 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + FF50DDC22B07DF0C00E87362 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + " $(SRCROOT)/${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}", + " $(SRCROOT)/${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}", + " $(SRCROOT)/${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist", + " $(SRCROOT)/$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist", + " $(SRCROOT)/$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\n\"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n"; + }; FF748B5A2AB34A61004748A5 /* SwiftLintScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -805,7 +832,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; @@ -1161,6 +1188,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + FF153AFE2B07C3E000D0BA30 /* FirebaseCrashlytics */ = { + isa = XCSwiftPackageProductDependency; + package = FFC8CDA52AA3867A00D129A6 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseCrashlytics; + }; FF4E82BD2AD39863004949AF /* FirebaseRemoteConfig */ = { isa = XCSwiftPackageProductDependency; package = FFC8CDA52AA3867A00D129A6 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; diff --git a/Basic-Car-Maintenance/Shared/Dashboard/Views/DashboardView.swift b/Basic-Car-Maintenance/Shared/Dashboard/Views/DashboardView.swift index de8e6d20..ccfe988b 100644 --- a/Basic-Car-Maintenance/Shared/Dashboard/Views/DashboardView.swift +++ b/Basic-Car-Maintenance/Shared/Dashboard/Views/DashboardView.swift @@ -125,6 +125,8 @@ struct DashboardView: View { } Button { + // TODO: Show Paywall + // Can only add 3 events, adding the 4th triggers the paywall viewModel.isShowingAddMaintenanceEvent = true } label: { Image(systemName: SFSymbol.plus) @@ -149,6 +151,8 @@ struct DashboardView: View { .onChange(of: scenePhase) { _, newScenePhase in guard case .active = newScenePhase else { return } + // TODO: Show Paywall + guard let action = actionService.action, action == .newMaintenance else { diff --git a/Basic-Car-Maintenance/Shared/Odometer/Views/OdometerView.swift b/Basic-Car-Maintenance/Shared/Odometer/Views/OdometerView.swift index bbfa8f85..89833408 100644 --- a/Basic-Car-Maintenance/Shared/Odometer/Views/OdometerView.swift +++ b/Basic-Car-Maintenance/Shared/Odometer/Views/OdometerView.swift @@ -53,6 +53,8 @@ struct OdometerView: View { .toolbar { ToolbarItemGroup(placement: .primaryAction) { Button { + // TODO: Show Paywall + // if adding a 4th odometer reading, show paywall viewModel.isShowingAddOdometerReading = true } label: { Image(systemName: SFSymbol.plus) diff --git a/Basic-Car-Maintenance/Shared/Settings/Views/SettingsView.swift b/Basic-Car-Maintenance/Shared/Settings/Views/SettingsView.swift index 1397ba94..b6202263 100644 --- a/Basic-Car-Maintenance/Shared/Settings/Views/SettingsView.swift +++ b/Basic-Car-Maintenance/Shared/Settings/Views/SettingsView.swift @@ -106,7 +106,8 @@ struct SettingsView: View { Text(vin) } - if let licensePlateNumber = vehicle.licensePlateNumber, !licensePlateNumber.isEmpty { + if let licensePlateNumber = vehicle.licensePlateNumber, + !licensePlateNumber.isEmpty { Text(licensePlateNumber) } } @@ -127,6 +128,8 @@ struct SettingsView: View { } Button { + // TODO: Show Paywall + // Show paywall if adding more than 1 vehicle, or show the `isShowingAddVehicle` view isShowingAddVehicle = true } label: { Text("Add Vehicle", comment: "Label to add a vehicle.") @@ -231,6 +234,8 @@ struct SettingsView: View { .onChange(of: scenePhase) { _, newScenePhase in guard case .active = newScenePhase else { return } + // TODO: Show Paywall + guard let action = actionService.action, action == .addVehicle else {