Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOB-2979] Analytics Spy Tests #799

Merged
merged 41 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b551bd0
Remove unused Analytics methods
lucaschifino Oct 16, 2024
6c10009
Re-add App open as Default Browser
lucaschifino Oct 16, 2024
c8da9e2
Add space above Ecosia comment
lucaschifino Oct 16, 2024
c7d20a0
Re-add default browser settings click
lucaschifino Oct 16, 2024
fadad99
Re-add toolbar position change tracking
lucaschifino Oct 17, 2024
7079cfe
Re-add missing context menu clicks
lucaschifino Oct 17, 2024
27562e4
Re-add menu status changes
lucaschifino Oct 17, 2024
0162f34
Rename ntpCustomization and create specific values section
lucaschifino Oct 17, 2024
6c3c32a
Split onboarding specific labels
lucaschifino Oct 17, 2024
baac95d
Refactor and group Referrals analytics
lucaschifino Oct 17, 2024
76efaa9
Add all previously hardcoded strings to Analytics.Values
lucaschifino Oct 17, 2024
a2de38d
Reorder and mark Analytics methods
lucaschifino Oct 17, 2024
4fc31ea
Clean up Analytics.Values and reorder alphabetically
lucaschifino Oct 17, 2024
a57e91a
Merge remote-tracking branch 'origin/main' into ls-mob-2893-analytics…
lucaschifino Oct 17, 2024
ad5205c
Create AnalyticsSpyTests with initial example
lucaschifino Oct 18, 2024
0dd57f0
Add AppDelegate spying tests
lucaschifino Oct 18, 2024
dd80ede
Add TODO
lucaschifino Oct 18, 2024
c294bc0
Merge remote-tracking branch 'origin/main' into ls-mob-2979-analytics…
lucaschifino Oct 22, 2024
00d4ab4
Merge remote-tracking branch 'origin/main' into ls-mob-2979-analytics…
lucaschifino Oct 29, 2024
c3df164
Create SwiftLint custom rule
lucaschifino Oct 30, 2024
a24e357
Fix lint warnings on tests
lucaschifino Oct 30, 2024
22b177d
Add remaining menu click tests
lucaschifino Oct 30, 2024
7da234c
Add menu share tests
lucaschifino Oct 30, 2024
183877b
Skip flaky tests
lucaschifino Oct 31, 2024
e5c95d5
Merge remote-tracking branch 'origin/main' into ls-mob-2979-analytics…
lucaschifino Oct 31, 2024
a5e0bbc
[MOB-3032] Fix wrong title
lucaschifino Oct 31, 2024
1239ae4
Add menu status tests
lucaschifino Oct 31, 2024
b932641
Add bookmark tests
lucaschifino Oct 31, 2024
fc95999
[MOB-3030] Skipping one more flaky test
lucaschifino Oct 31, 2024
aea176b
Add SwiftLint section to README
lucaschifino Nov 1, 2024
1d64891
Add SwiftLint Github Action
lucaschifino Nov 1, 2024
c1caf70
Remove strict from linting action
lucaschifino Nov 1, 2024
38df72b
[MOB-3030] Disable flaky tests on the correct target
lucaschifino Nov 1, 2024
01d5387
Remove duplicated analytics activity tests
lucaschifino Nov 1, 2024
d8be796
Use correct helper action on shortcut test
lucaschifino Nov 1, 2024
bd1d194
Fix menu status flakyness
lucaschifino Nov 4, 2024
78df570
[MOB-3030] Skipping more flaky tests
lucaschifino Nov 4, 2024
18a6c23
Wait for until launch is called
lucaschifino Nov 4, 2024
e4d09bb
Use waitForCondition on resume as well
lucaschifino Nov 4, 2024
3e02646
Merge remote-tracking branch 'origin/main' into ls-mob-2979-analytics…
lucaschifino Nov 4, 2024
951c7cc
[MOB-3030] Skipping yet one more flaky test
lucaschifino Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/swift_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: SwiftLint
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/realm/swiftlint:5.5-latest

steps:
- uses: actions/checkout@v3

- name: SwiftLint
run: |
swiftlint --reporter github-actions-logging
32 changes: 28 additions & 4 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ only_rules: # Only enforce these rules, ignore all others
- empty_parameters
- empty_parentheses_with_trailing_closure
- for_where
- force_try
# Ecosia: disabled
# - force_try
- implicit_getter
- inclusive_language
- invalid_swiftlint_command
- large_tuple
# Ecosia: disabled
# - large_tuple
- leading_whitespace
- legacy_cggeometry_functions
- legacy_constant
Expand All @@ -44,7 +46,8 @@ only_rules: # Only enforce these rules, ignore all others
- syntactic_sugar
- trailing_newline
- trailing_semicolon
- trailing_whitespace
# Ecosia: disabled
# - trailing_whitespace
- unavailable_condition
- unneeded_override
- unneeded_synthesized_initializer
Expand All @@ -64,7 +67,8 @@ only_rules: # Only enforce these rules, ignore all others
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- empty_collection_literal
- empty_count
# Ecosia: disabled
# - empty_count
- empty_string
- empty_xctest_method
- explicit_init
Expand All @@ -81,6 +85,8 @@ only_rules: # Only enforce these rules, ignore all others
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition
# Ecosia: enabled
- custom_rules

# These rules were originally opted into. Disabling for now to get
# Swiftlint up and running.
Expand All @@ -91,6 +97,24 @@ only_rules: # Only enforce these rules, ignore all others
# - prohibited_super_call
# - protocol_property_accessors_order

# Ecosia: created custom rules
custom_rules:
reassign_analytics_instance:
included:
- ".*\\.swift"
excluded:
- "EcosiaTests/*"
regex: "(Analytics.shared =)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆

capture_group: 0
match_kinds:
- comment
- identifier
message: "We should not re-assign Analytics shared instance outside tests."
severity: error
no_hiding_in_strings:
regex: "(Analytics.shared =)"
match_kinds: string

file_header:
required_string: |
// This Source Code Form is subject to the terms of the Mozilla Public
Expand Down
26 changes: 17 additions & 9 deletions Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
0BB5B30B1AC0AD1F0052877D /* LoginsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BB5B30A1AC0AD1F0052877D /* LoginsHelper.swift */; };
0BF0DB941A8545800039F300 /* URLBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF0DB931A8545800039F300 /* URLBarView.swift */; };
0BF1B7E31AC60DEA00A7B407 /* InsetButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF1B7E21AC60DEA00A7B407 /* InsetButton.swift */; };
1285E2B52CC293CA0053506B /* AnalyticsSpyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1285E2B42CC293CA0053506B /* AnalyticsSpyTests.swift */; };
1285E2B72CC68BF00053506B /* APNConsentOnLaunchExperiment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1285E2B62CC68BF00053506B /* APNConsentOnLaunchExperiment.swift */; };
158241282820698B00956B39 /* RustRemoteTabsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 158241272820698B00956B39 /* RustRemoteTabsTests.swift */; };
15DE98FD27FCED4F00F1ECDB /* RustRemoteTabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DE98FC27FCED4F00F1ECDB /* RustRemoteTabs.swift */; };
Expand Down Expand Up @@ -355,7 +356,7 @@
2C6C90902C614A76007D9B43 /* OnboardingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD368492C5BC31700972871 /* OnboardingTests.swift */; };
2C728D7E2CBBDCDC00C7684B /* UnleashUserDefaultsSeedProgressManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C728D7D2CBBDCDC00C7684B /* UnleashUserDefaultsSeedProgressManagerTests.swift */; };
2C78374B2C1765DF00BBFFEB /* LoadingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCFB3D42C0F1EA500BEDCA0 /* LoadingScreen.swift */; };
2C7DBABD2C4EA37200BCD03F /* AnalyticsFeatureManagementIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C7DBABB2C4EA17200BCD03F /* AnalyticsFeatureManagementIntegrationTests.swift */; };
2C7DBABD2C4EA37200BCD03F /* AppDelegateFeatureManagementIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C7DBABB2C4EA17200BCD03F /* AppDelegateFeatureManagementIntegrationTests.swift */; };
2C82625A2C64BB9300E2A255 /* DeviceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C8262592C64BB9300E2A255 /* DeviceType.swift */; };
2C82625C2C6648D900E2A255 /* LocalizationOverrideTestingBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C82625B2C6648D900E2A255 /* LocalizationOverrideTestingBundle.swift */; };
2C82625E2C66661700E2A255 /* EcosiaMockThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C82625D2C66661700E2A255 /* EcosiaMockThemeManager.swift */; };
Expand All @@ -372,7 +373,6 @@
2CA9952A2CA2C0BB001064CC /* NTPConfigurableNudgeCardCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CA995292CA2C0BB001064CC /* NTPConfigurableNudgeCardCellViewModel.swift */; };
2CABD7162C11C9CC00A0750F /* MozillaAppServices in Frameworks */ = {isa = PBXBuildFile; productRef = 2CABD7152C11C9CC00A0750F /* MozillaAppServices */; };
2CABD7282C12EF1E00A0750F /* PrivateModeButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CABD7272C12EF1E00A0750F /* PrivateModeButtonTests.swift */; };
2CC8AC342C4F887D000A669A /* MockAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC8AC332C4F887D000A669A /* MockAnalytics.swift */; };
2CCBB5232CAE9826006E2E10 /* ArcProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCBB5222CAE9826006E2E10 /* ArcProgressView.swift */; };
2CCBB5252CAEA9DF006E2E10 /* SeedProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCBB5242CAEA9DF006E2E10 /* SeedProgressView.swift */; };
2CCBB5272CAEAD53006E2E10 /* SeedCounterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCBB5262CAEAD53006E2E10 /* SeedCounterView.swift */; };
Expand Down Expand Up @@ -2015,6 +2015,7 @@
12674A038346A46589A0AC0B /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = "el.lproj/Default Browser.strings"; sourceTree = "<group>"; };
126A40A4A5AFDFD655B0FDF4 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/ClearHistoryConfirm.strings; sourceTree = "<group>"; };
126F44CCB14373DC7813DE1F /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/ClearPrivateDataConfirm.strings; sourceTree = "<group>"; };
1285E2B42CC293CA0053506B /* AnalyticsSpyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSpyTests.swift; sourceTree = "<group>"; };
1285E2B62CC68BF00053506B /* APNConsentOnLaunchExperiment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APNConsentOnLaunchExperiment.swift; sourceTree = "<group>"; };
12EA4881BFBE296298150D4A /* bn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bn; path = bn.lproj/LoginManager.strings; sourceTree = "<group>"; };
12F949169C30744CCC749588 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/HistoryPanel.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2501,7 +2502,7 @@
2C6C90822C614A16007D9B43 /* EcosiaSnapshotTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EcosiaSnapshotTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2C6E44099EACF7BE5438CEB6 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Today.strings; sourceTree = "<group>"; };
2C728D7D2CBBDCDC00C7684B /* UnleashUserDefaultsSeedProgressManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnleashUserDefaultsSeedProgressManagerTests.swift; sourceTree = "<group>"; };
2C7DBABB2C4EA17200BCD03F /* AnalyticsFeatureManagementIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsFeatureManagementIntegrationTests.swift; sourceTree = "<group>"; };
2C7DBABB2C4EA17200BCD03F /* AppDelegateFeatureManagementIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegateFeatureManagementIntegrationTests.swift; sourceTree = "<group>"; };
2C8262572C64424300E2A255 /* EcosiaSnapshotTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = EcosiaSnapshotTests.xctestplan; sourceTree = "<group>"; };
2C8262592C64BB9300E2A255 /* DeviceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceType.swift; sourceTree = "<group>"; };
2C82625B2C6648D900E2A255 /* LocalizationOverrideTestingBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationOverrideTestingBundle.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2540,7 +2541,6 @@
2CBCAB0D2B88EEE40080AD68 /* EcosiaDebug.WidgetKit.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = EcosiaDebug.WidgetKit.xcconfig; sourceTree = "<group>"; };
2CBCAB0E2B88EEE40080AD68 /* EcosiaDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = EcosiaDebug.xcconfig; sourceTree = "<group>"; };
2CC1B3EF1E9B861400814EEC /* DomainAutocompleteTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DomainAutocompleteTests.swift; sourceTree = "<group>"; };
2CC8AC332C4F887D000A669A /* MockAnalytics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockAnalytics.swift; sourceTree = "<group>"; };
2CCB296620A99C9500121DD8 /* LoginsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginsTests.swift; sourceTree = "<group>"; };
2CCBB5222CAE9826006E2E10 /* ArcProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArcProgressView.swift; sourceTree = "<group>"; };
2CCBB5242CAEA9DF006E2E10 /* SeedProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedProgressView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -7946,6 +7946,15 @@
path = SearchQuickLinksMedium;
sourceTree = "<group>";
};
1285E2B32CC293A20053506B /* Analytics */ = {
isa = PBXGroup;
children = (
2CE294692B7FC5A5006C22B2 /* AnalyticsTests.swift */,
1285E2B42CC293CA0053506B /* AnalyticsSpyTests.swift */,
);
path = Analytics;
sourceTree = "<group>";
};
1D7B78952ADF324E0011E9F2 /* Event Queue */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -8860,7 +8869,7 @@
2C7DBABA2C4EA14C00BCD03F /* IntegrationTests */ = {
isa = PBXGroup;
children = (
2C7DBABB2C4EA17200BCD03F /* AnalyticsFeatureManagementIntegrationTests.swift */,
2C7DBABB2C4EA17200BCD03F /* AppDelegateFeatureManagementIntegrationTests.swift */,
);
path = IntegrationTests;
sourceTree = "<group>";
Expand All @@ -8869,7 +8878,6 @@
isa = PBXGroup;
children = (
2C872A532B8CD47600B318A0 /* MockAppVersionInfoProvider.swift */,
2CC8AC332C4F887D000A669A /* MockAnalytics.swift */,
);
path = Mocks;
sourceTree = "<group>";
Expand Down Expand Up @@ -8941,11 +8949,11 @@
2CE2945C2B7FC51E006C22B2 /* EcosiaTests */ = {
isa = PBXGroup;
children = (
1285E2B32CC293A20053506B /* Analytics */,
2C16B7642CAF2417006118F8 /* ClimateImpactCounter */,
2CD3683F2C5BA30A00972871 /* SnapshotTests */,
2C7DBABA2C4EA14C00BCD03F /* IntegrationTests */,
2C872A522B8CD45F00B318A0 /* Mocks */,
2CE294692B7FC5A5006C22B2 /* AnalyticsTests.swift */,
2CE294672B7FC5A4006C22B2 /* EcosiaInstallTypeTests.swift */,
2CE2946C2B7FC5A5006C22B2 /* EcosiaNTPTooltipHighlightTests.swift */,
2CE2946D2B7FC5A5006C22B2 /* EcosiaPageActionMenuCellTests.swift */,
Expand Down Expand Up @@ -14566,7 +14574,6 @@
3943A81D1E9807C700D4F6DC /* FxAPushMessageTest.swift in Sources */,
212985E72A72B39D00546684 /* ThemeSettingsControllerTests.swift in Sources */,
8A9E46BD2A6599E5003327D4 /* MockStatusBarScrollDelegate.swift in Sources */,
2CC8AC342C4F887D000A669A /* MockAnalytics.swift in Sources */,
E1463D0629830E4F0074E16E /* MockUserNotificationCenter.swift in Sources */,
439B78182A09721600CAAE37 /* CreditCardHelperTests.swift in Sources */,
8ADED7F0276A7788009C19E6 /* CumulativeDaysOfUseCounterTests.swift in Sources */,
Expand Down Expand Up @@ -14595,7 +14602,7 @@
5AF6254728A58AC100A90253 /* MockHistoryHighlightsDataAdaptor.swift in Sources */,
8A7A26E329D4ACF300EA76F1 /* SceneCoordinatorTests.swift in Sources */,
39C137972655798A003DC662 /* NimbusIntegrationTests.swift in Sources */,
2C7DBABD2C4EA37200BCD03F /* AnalyticsFeatureManagementIntegrationTests.swift in Sources */,
2C7DBABD2C4EA37200BCD03F /* AppDelegateFeatureManagementIntegrationTests.swift in Sources */,
215B458427DA87FC00E5E800 /* TabMetadataManagerTests.swift in Sources */,
2173326A29CCF901007F20C7 /* UIPanGestureRecognizerMock.swift in Sources */,
5A9A09D628B01FD500B6F51E /* MockURLBarView.swift in Sources */,
Expand Down Expand Up @@ -14653,6 +14660,7 @@
8A5604F629DF09FA00035CA3 /* MockLaunchCoordinatorDelegate.swift in Sources */,
C807CCCC28367446008E6A5A /* FeatureFlagManagerTests.swift in Sources */,
8A5C3BC5282ABF8E003A8CCF /* LegacyRemoteTabsPanelTests.swift in Sources */,
1285E2B52CC293CA0053506B /* AnalyticsSpyTests.swift in Sources */,
8AABBD032A001CBC0089941E /* MockApplicationHelper.swift in Sources */,
8A1E3BE328CBACDD003388C4 /* SponsoredContentFilterUtilityTests.swift in Sources */,
2173326829CCDA8E007F20C7 /* TabScrollControllerTests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CD368442C5BC31700972871"
BlueprintIdentifier = "2C6C90812C614A16007D9B43"
BuildableName = "EcosiaSnapshotTests.xctest"
BlueprintName = "EcosiaSnapshotTests"
ReferencedContainer = "container:Client.xcodeproj">
Expand Down
6 changes: 2 additions & 4 deletions Client/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private var widgetManager: TopSitesWidgetManager?
private var menuBuilderHelper: MenuBuilderHelper?
private var metricKitWrapper = MetricKitWrapper()
// Ecosia: Add analytics
var analytics: AnalyticsProtocol = Analytics.shared

/// Tracking active status of the application.
private var isActive = false
Expand Down Expand Up @@ -192,7 +190,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
Task {
await FeatureManagement.fetchConfiguration()
// Ecosia: Lifecycle tracking. Needs to happen after Unleash start so that the flags are correctly added to the analytics context.
analytics.activity(.launch)
Analytics.shared.activity(.launch)
// Ecosia: Engagement Service Initialization helper
await ClientEngagementService.shared.initializeAndRefreshNotificationRegistration(notificationCenterDelegate: self)
// Ecosia: Experiment that directly asks for consent
Expand Down Expand Up @@ -259,7 +257,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Ecosia
Task {
await FeatureManagement.fetchConfiguration()
analytics.activity(.resume)
Analytics.shared.activity(.resume)
}
MMP.sendSession()
searchesCounter.subscribe(self) { searchCount in
Expand Down
10 changes: 3 additions & 7 deletions Client/Ecosia/Analytics/Analytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import Foundation
import SnowplowTracker
import Core

protocol AnalyticsProtocol {
func activity(_ action: Analytics.Action.Activity)
}

final class Analytics: AnalyticsProtocol {
open class Analytics {
static let installSchema = "iglu:org.ecosia/ios_install_event/jsonschema/1-0-0"
private static let abTestSchema = "iglu:org.ecosia/abtest_context/jsonschema/1-0-1"
private static let consentSchema = "iglu:org.ecosia/eccc_context/jsonschema/1-0-2"
Expand All @@ -23,10 +19,10 @@ final class Analytics: AnalyticsProtocol {
Self.appResumeDailyTrackingPluginConfiguration])!
}

static let shared = Analytics()
static var shared = Analytics()
private var tracker: TrackerController

private init() {
internal init() {
tracker = Self.tracker
tracker.installAutotracking = true
tracker.screenViewAutotracking = false
Expand Down
2 changes: 1 addition & 1 deletion Client/Ecosia/UI/EmptyBookmarksView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ final class EmptyBookmarksView: UIView, Themeable {
}
}

@objc private func onLearnMoreTapped() {
@objc func onLearnMoreTapped() {
Analytics.shared.bookmarksEmptyLearnMoreClicked()
delegate?.emptyBookmarksViewLearnMoreTapped(self)
}
Expand Down
4 changes: 0 additions & 4 deletions Client/Frontend/Browser/MainMenuActionHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -951,11 +951,7 @@ class MainMenuActionHelper: PhotonActionSheetProtocol,
}

private func getRemoveShortcutAction() -> SingleActionViewModel {
/* Ecosia: Update Image
return SingleActionViewModel(title: .AppMenu.RemoveFromShortcuts,
iconString: StandardImageIdentifiers.Large.pinSlash) { _ in
*/
return SingleActionViewModel(title: .AddToShortcutsActionTitle,
iconString: "action_unpin") { _ in
guard let url = self.selectedTab?.url?.displayURL,
let title = self.selectedTab?.displayTitle else { return }
Expand Down
Loading
Loading