diff --git a/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m b/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m index e677f0154..4d9cf65af 100644 --- a/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m +++ b/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m @@ -1113,6 +1113,17 @@ - (void) logEvent:(FBSDKAppEventName)eventName return; } + + BOOL isProtectedModeApplied = (self.protectedModeManager && [FBSDKProtectedModeManager isProtectedModeAppliedWithParameters:parameters]); + if (!isProtectedModeApplied && self.sensitiveParamsManager) { + @try { + parameters = [self.sensitiveParamsManager processParameters:parameters eventName:eventName]; + } @catch(NSException *exception) { + [self.logger singleShotLogEntry:FBSDKLoggingBehaviorAppEvents + logEntry:@"FBSDKAppEvents: caught exception while processing sensitiveParamsManager."]; + } + } + if (self.macaRuleMatchingManager) { @try { parameters = [self.macaRuleMatchingManager processParameters:parameters event:eventName?:@""]; @@ -1156,6 +1167,7 @@ - (void) logEvent:(FBSDKAppEventName)eventName // Filter out restrictive keys parameters = [self.restrictiveDataFilterParameterProcessor processParameters:parameters eventName:eventName]; + // Filter out non-standard params if (self.protectedModeManager) { @try { @@ -1163,12 +1175,6 @@ - (void) logEvent:(FBSDKAppEventName)eventName } @catch(NSException *exception) {} } - BOOL isProtectedModeApplied = (self.protectedModeManager && [FBSDKProtectedModeManager isProtectedModeAppliedWithParameters:parameters]); - if (!isProtectedModeApplied && self.sensitiveParamsManager) { - @try { - parameters = [self.sensitiveParamsManager processParameters:parameters eventName:eventName]; - } @catch(NSException *exception) {} - } NSMutableDictionary *eventDictionary = [NSMutableDictionary dictionaryWithDictionary:parameters ?: @{}]; [FBSDKTypeUtility dictionary:eventDictionary setObject:eventName forKey:FBSDKAppEventParameterNameEventName]; diff --git a/FBSDKCoreKit/FBSDKCoreKit/include/FBSDKFeature.h b/FBSDKCoreKit/FBSDKCoreKit/include/FBSDKFeature.h index bf4087910..0873d12ad 100644 --- a/FBSDKCoreKit/FBSDKCoreKit/include/FBSDKFeature.h +++ b/FBSDKCoreKit/FBSDKCoreKit/include/FBSDKFeature.h @@ -47,10 +47,10 @@ typedef NS_ENUM(NSUInteger, FBSDKFeature) { FBSDKFeatureIntelligentIntegrity = 0x01010402, FBSDKFeatureModelRequest = 0x01010403, FBSDKFeatureProtectedMode = 0x01010404, + FBSDKFeatureFilterSensitiveParams = 0x01010408, FBSDKFeatureMACARuleMatching = 0x01010405, FBSDKFeatureBlocklistEvents = 0x01010406, FBSDKFeatureFilterRedactedEvents = 0x01010407, - FBSDKFeatureFilterSensitiveParams = 0x01010408, FBSDKFeatureEventDeactivation = 0x01010500, FBSDKFeatureSKAdNetwork = 0x01010600, FBSDKFeatureSKAdNetworkConversionValue = 0x01010601,