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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰] Enable Firebase Analytics DebugView for TestFlight builds #7648

Closed
thibaultcapelli opened this issue Feb 26, 2024 · 1 comment
Closed
Labels
Help: Needs Triage Issue needs additional investigation/triaging. Impact: Bug New bug report

Comments

@thibaultcapelli
Copy link

Issue

I want to test my analytics integration from TestFlight but the flag "-FIRDebugEnabled" does not take effect in release builds.
I tested to add the flag from the AppDelegate code without any success.

iOS

AppDelegate.m:

    NSProcessInfo *processInfo = [NSProcessInfo processInfo];
    NSArray *arguments = [processInfo arguments];
    NSMutableArray *newArguments = [NSMutableArray arrayWithArray:arguments];

    [newArguments addObject:@"-FIRDebugEnabled"];

    [[NSProcessInfo processInfo] setValue:[newArguments copy] forKey:@"arguments"];
@thibaultcapelli thibaultcapelli added Help: Needs Triage Issue needs additional investigation/triaging. Impact: Bug New bug report labels Feb 26, 2024
@thibaultcapelli thibaultcapelli changed the title [馃悰] Bug Report Title - CHANGE ME [馃悰] Enable Firebase Analytics DebugView for TesFlight builds Feb 26, 2024
@thibaultcapelli thibaultcapelli changed the title [馃悰] Enable Firebase Analytics DebugView for TesFlight builds [馃悰] Enable Firebase Analytics DebugView for TestFlight builds Feb 26, 2024
@thibaultcapelli
Copy link
Author

My solution is finally to copy the source code and toggle the service with react-native-config

AppDelegate.m:

New imports:
  #import <GoogleUtilities/GULLogger.h>
  #import "RNCConfig.h"
didFinishLaunchingWithOptions code:
  NSString *firebaseDebugMode = [RNCConfig envFor:@"FIREBASE_DEBUG_MODE"];
  
  if (firebaseDebugMode != nil && [firebaseDebugMode isEqualToString:@"enabled"]) {
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"/google/measurement/debug_mode"];
    GULLoggerForceDebug();
  }
  
  [FIRApp configure];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help: Needs Triage Issue needs additional investigation/triaging. Impact: Bug New bug report
Projects
None yet
Development

No branches or pull requests

1 participant