From da1ac6b00d4209ca431259e192c91797d3c45cb9 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Wed, 30 Oct 2024 10:11:09 -0500 Subject: [PATCH] feat(crashlytics, ios): add native helper log / setCustomValue methods user request, useful for "brownfield" apps that have custom native code and want to use crashlytics native methods from their own native code --- .../ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h | 4 ++++ .../ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h b/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h index 04cbb33be7..55c75d64c9 100644 --- a/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h +++ b/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h @@ -22,4 +22,8 @@ + (void)recordNativeError:(NSError *)error; ++ (void)log:(nonnull NSString *)msg; + ++ (void)setCustomValue:(nullable id)value forKey:(nonnull NSString *)key; + @end diff --git a/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m b/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m index 6fb7697853..8abd8cec52 100644 --- a/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m +++ b/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m @@ -25,4 +25,12 @@ + (void)recordNativeError:(NSError *)error { [[FIRCrashlytics crashlytics] recordError:error]; } ++ (void)log:(nonnull NSString *)msg { + [[FIRCrashlytics crashlytics] log:msg]; +} + ++ (void)setCustomValue:(nullable id)value forKey:(nonnull NSString *)key { + [[FIRCrashlytics crashlytics] setCustomValue:value forKey:key]; +} + @end