From 42dd48fced74ec6294d9b5314e94d35f8cd05cde Mon Sep 17 00:00:00 2001 From: Litianu Razvan Date: Tue, 21 Jan 2025 15:33:01 +0200 Subject: [PATCH] Add FXIOS-10666 Implement iOS "onboarding-opt-out" ping (#24101) * Add FXIOS-10902 Firefox iOS: Send data deletion request when DAU ping is toggled off * Update data review link * Fix PR comments --- firefox-ios/Client.xcodeproj/project.pbxproj | 4 ++++ .../PrivacyPreferencesViewController.swift | 4 ++++ firefox-ios/Client/pings.yaml | 23 +++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/firefox-ios/Client.xcodeproj/project.pbxproj b/firefox-ios/Client.xcodeproj/project.pbxproj index 73929b8fb1bc..7559ac395e1c 100644 --- a/firefox-ios/Client.xcodeproj/project.pbxproj +++ b/firefox-ios/Client.xcodeproj/project.pbxproj @@ -1137,6 +1137,7 @@ 8CC6170B2C358BAC001C7688 /* ActionToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CC6170A2C358BAC001C7688 /* ActionToast.swift */; }; 8CCCB08B2AE26B5C0073ADB9 /* ReportResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CCCB08A2AE26B5C0073ADB9 /* ReportResponse.swift */; }; 8CCD74732B90A945008F919B /* LoginListViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CCD74722B90A945008F919B /* LoginListViewModelTests.swift */; }; + 8CDA04872D351783004C333C /* pings.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 8CDA04862D351783004C333C /* pings.yaml */; }; 8CE1E4322B8C76AE0026530B /* LoginStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CE1E4312B8C76AE0026530B /* LoginStorage.swift */; }; 8CE1E4372B8C76C80026530B /* LoginAutofillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CE1E4332B8C76C80026530B /* LoginAutofillView.swift */; }; 8CE1E4382B8C76C80026530B /* LoginListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CE1E4342B8C76C80026530B /* LoginListViewModel.swift */; }; @@ -7979,6 +7980,7 @@ 8CCCB08A2AE26B5C0073ADB9 /* ReportResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportResponse.swift; sourceTree = ""; }; 8CCD74722B90A945008F919B /* LoginListViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginListViewModelTests.swift; sourceTree = ""; }; 8CD04F1485CE61A3B3237248 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/3DTouchActions.strings; sourceTree = ""; }; + 8CDA04862D351783004C333C /* pings.yaml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = pings.yaml; sourceTree = ""; }; 8CE041B18298F668144B225A /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Menu.strings; sourceTree = ""; }; 8CE1E4312B8C76AE0026530B /* LoginStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginStorage.swift; sourceTree = ""; }; 8CE1E4332B8C76C80026530B /* LoginAutofillView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginAutofillView.swift; sourceTree = ""; }; @@ -14359,6 +14361,7 @@ 7B2142FC1E5E055000CDD3FC /* InfoPlist.strings */, 74821FFD1DB6D3AC00EEEA72 /* MailSchemes.plist */, ACD605D124B35EEE00EE4454 /* metrics.yaml */, + 8CDA04862D351783004C333C /* pings.yaml */, C87D8B7E2818331900A6307D /* Nimbus */, DFACDFAD274D4D4B00A94EEC /* Protocols */, 216A0D6F2A40D0E4008077BA /* Redux */, @@ -15653,6 +15656,7 @@ 43175DB626B8774D00C41C31 /* Ads.js in Resources */, D0FCF8081FE4772D004A7995 /* MainFrameAtDocumentStart.js in Resources */, D30684F11C84F12A002D8D82 /* SearchPlugins in Resources */, + 8CDA04872D351783004C333C /* pings.yaml in Resources */, 8A5CDEED27E510F500CC60FF /* pocketglobalfeed.json in Resources */, 8A1A93582B757C7C0069C190 /* gradient.json in Resources */, 74821FFE1DB6D3AC00EEEA72 /* MailSchemes.plist in Resources */, diff --git a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift index 9db360fa9677..e3fe8e4719ca 100644 --- a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift +++ b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift @@ -6,6 +6,7 @@ import UIKit import Common import ComponentLibrary import Shared +import Glean final class PrivacyPreferencesViewController: UIViewController, Themeable, @@ -168,6 +169,9 @@ final class PrivacyPreferencesViewController: UIViewController, technicalDataSwitch.switchCallback = { [weak self] value in self?.profile.prefs.setBool(value, forKey: AppConstants.prefSendUsageData) + if !value { + GleanMetrics.Pings.shared.onboardingOptOut.submit() + } TermsOfServiceTelemetry().technicalInteractionDataSwitched(to: value) } diff --git a/firefox-ios/Client/pings.yaml b/firefox-ios/Client/pings.yaml index 245ed9924901..e11eb16c090d 100644 --- a/firefox-ios/Client/pings.yaml +++ b/firefox-ios/Client/pings.yaml @@ -91,3 +91,26 @@ usage-reporting: include_info_sections: false ping_schedule: - baseline + +onboarding-opt-out: + description: | + This ping is submitted when a user opts out of + usage-reporting during the onboarding process. + It is sent immediately upon opting out of Telemetry/Usage Tracking (T/UT) + at ToS consent. This ping will only ever be sent during the + initial onboarding flow. + If the global telemetry preference is disabled, this ping + includes specific settings to ensure it can still be submitted. + include_client_id: false + send_if_empty: true + bugs: + - https://mozilla-hub.atlassian.net/browse/FXIOS-10902 + data_reviews: + - https://github.com/mozilla-mobile/firefox-ios/pull/24101 + notification_emails: + - glean-team@mozilla.com + - jrediger@mozilla.com + - loines@mozilla.com + metadata: + follows_collection_enabled: false + include_info_sections: false