From 9bc06713e28e1a9a6152974687be6d25a82af392 Mon Sep 17 00:00:00 2001 From: Zilin Zhang Date: Mon, 29 Jul 2024 16:07:48 -0700 Subject: [PATCH] Update default standard parameters Summary: Remove fb_search_string, fb_status, fb_content_name, fb_content_category from default standard parameters Reviewed By: seanmksha Differential Revision: D60362112 fbshipit-source-id: 05b3f101a6a8bf422805e95e545b624b488841d8 --- .../Integrity/ProtectedModeManager.swift | 6 +- .../Integrity/ProtectedModeManagerTests.swift | 143 ++++++++++++++++++ 2 files changed, 144 insertions(+), 5 deletions(-) diff --git a/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/Integrity/ProtectedModeManager.swift b/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/Integrity/ProtectedModeManager.swift index 86f858ff8..0c8e8f374 100644 --- a/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/Integrity/ProtectedModeManager.swift +++ b/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/Integrity/ProtectedModeManager.swift @@ -12,7 +12,7 @@ import Foundation public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing { private var isEnabled = false private static let pmKey = AppEvents.ParameterName(rawValue: "pm") - private let standardParametersDefault: Set = [ + let standardParametersDefault: Set = [ "_currency", "_valueToSum", "fb_availability", @@ -21,9 +21,7 @@ public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing "fb_checkout_date", "fb_city", "fb_condition_of_vehicle", - "fb_content_category", "fb_content_ids", - "fb_content_name", "fb_content_type", "fb_contents", "fb_country", @@ -66,9 +64,7 @@ public final class ProtectedModeManager: NSObject, _AppEventsParameterProcessing "fb_region", "fb_returning_arrival_date", "fb_returning_departure_date", - "fb_search_string", "fb_state_of_vehicle", - "fb_status", "fb_suggested_destinations", "fb_suggested_home_listings", "fb_suggested_hotels", diff --git a/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEvents/Integrity/ProtectedModeManagerTests.swift b/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEvents/Integrity/ProtectedModeManagerTests.swift index 5e7d278af..d07e75964 100644 --- a/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEvents/Integrity/ProtectedModeManagerTests.swift +++ b/FBSDKCoreKit/FBSDKCoreKitTests/Internal/AppEvents/Integrity/ProtectedModeManagerTests.swift @@ -17,6 +17,149 @@ final class ProtectedModeManagerTests: XCTestCase { AppEvents.ParameterName.implicitlyLogged: true, ] + func testDefaultParameters() { + let expectedDParameters: Set = [ + "_currency", + "_valueToSum", + "fb_availability", + "fb_body_style", + "fb_checkin_date", + "fb_checkout_date", + "fb_city", + "fb_condition_of_vehicle", + "fb_content_ids", + "fb_content_type", + "fb_contents", + "fb_country", + "fb_currency", + "fb_delivery_category", + "fb_departing_arrival_date", + "fb_departing_departure_date", + "fb_destination_airport", + "fb_destination_ids", + "fb_dma_code", + "fb_drivetrain", + "fb_exterior_color", + "fb_fuel_type", + "fb_hotel_score", + "fb_interior_color", + "fb_lease_end_date", + "fb_lease_start_date", + "fb_listing_type", + "fb_make", + "fb_mileage.unit", + "fb_mileage.value", + "fb_model", + "fb_neighborhood", + "fb_num_adults", + "fb_num_children", + "fb_num_infants", + "fb_num_items", + "fb_order_id", + "fb_origin_airport", + "fb_postal_code", + "fb_predicted_ltv", + "fb_preferred_baths_range", + "fb_preferred_beds_range", + "fb_preferred_neighborhoods", + "fb_preferred_num_stops", + "fb_preferred_price_range", + "fb_preferred_star_ratings", + "fb_price", + "fb_property_type", + "fb_region", + "fb_returning_arrival_date", + "fb_returning_departure_date", + "fb_state_of_vehicle", + "fb_suggested_destinations", + "fb_suggested_home_listings", + "fb_suggested_hotels", + "fb_suggested_jobs", + "fb_suggested_local_service_businesses", + "fb_suggested_location_based_items", + "fb_suggested_vehicles", + "fb_transmission", + "fb_travel_class", + "fb_travel_end", + "fb_travel_start", + "fb_trim", + "fb_user_bucket", + "fb_value", + "fb_vin", + "fb_year", + "lead_event_source", + "predicted_ltv", + "product_catalog_id", + "app_user_id", + "appVersion", + "_eventName", + "_eventName_md5", + "_currency", + "_implicitlyLogged", + "_inBackground", + "_isTimedEvent", + "_logTime", + "fb_order_id", + "_session_id", + "_ui", + "_valueToSum", + "_valueToUpdate", + "_is_fb_codeless", + "_is_suggested_event", + "_fb_pixel_referral_id", + "fb_pixel_id", + "trace_id", + "user_agent", + "subscription_id", + "predicted_ltv", + "event_id", + "_restrictedParams", + "_onDeviceParams", + "purchase_valid_result_type", + "core_lib_included", + "login_lib_included", + "share_lib_included", + "place_lib_included", + "messenger_lib_included", + "applinks_lib_included", + "marketing_lib_included", + "_codeless_action", + "sdk_initialized", + "billing_client_lib_included", + "billing_service_lib_included", + "user_data_keys", + "device_push_token", + "fb_mobile_pckg_fp", + "fb_mobile_app_cert_hash", + "aggregate_id", + "anonymous_id", + "campaign_ids", + "fb_post_attachment", + "receipt_data", + "ad_type", + "fb_content", + "fb_content_id", + "fb_content_type", + "fb_currency", + "fb_description", + "fb_level", + "fb_max_rating_value", + "fb_num_items", + "fb_order_id", + "fb_payment_info_available", + "fb_registration_method", + "fb_search_string", + "fb_success", + "pm", + "_audiencePropertyIds", + "cs_maca", + ] + XCTAssertEqual( + protectedModeManager.standardParametersDefault, + expectedDParameters + ) + } + func testProcessParametersWithoutEnable() { XCTAssertEqual( protectedModeManager.processParameters(sampleParameters, eventName: AppEvents.Name.addedToCart)?.count,