Skip to content

Commit

Permalink
Avoid +[FBSDKAppEvents singleton] call when overriding app ID (#1647)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1647

As title

Reviewed By: joesus

Differential Revision: D26371894

fbshipit-source-id: c7bbe931935b40c48c27a431e3face3377971f16
  • Loading branch information
dreamolight authored and facebook-github-bot committed Feb 10, 2021
1 parent 72bdc6b commit 50360a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
#define FBUnityUtilityUpdateBindingsSelector @"triggerUpdateBindings:"

static NSString *g_overrideAppID = nil;
static BOOL g_explicitEventsLoggedYet;

@interface FBSDKAppEvents ()

Expand All @@ -342,7 +343,6 @@ @interface FBSDKAppEvents ()

@implementation FBSDKAppEvents
{
BOOL _explicitEventsLoggedYet;
FBSDKServerConfiguration *_serverConfiguration;
FBSDKAppEventsState *_appEventsState;
#if !TARGET_OS_TV
Expand Down Expand Up @@ -716,7 +716,7 @@ + (void)setLoggingOverrideAppID:(NSString *)appID
{
if (![g_overrideAppID isEqualToString:appID]) {
FBSDKConditionalLog(
![FBSDKAppEvents singleton]->_explicitEventsLoggedYet,
!g_explicitEventsLoggedYet,
FBSDKLoggingBehaviorDeveloperErrors,
@"[FBSDKAppEvents setLoggingOverrideAppID:] should only be called prior to any events being logged."
);
Expand Down Expand Up @@ -1153,8 +1153,8 @@ - (void)instanceLogEvent:(FBSDKAppEventName)eventName
return;
}

if (!isImplicitlyLogged && !_explicitEventsLoggedYet) {
_explicitEventsLoggedYet = YES;
if (!isImplicitlyLogged && !g_explicitEventsLoggedYet) {
g_explicitEventsLoggedYet = YES;
}
__block BOOL failed = ![FBSDKAppEventsUtility validateIdentifier:eventName];

Expand Down

0 comments on commit 50360a1

Please sign in to comment.