Skip to content

Commit da1ac6b

Browse files
committed
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
1 parent 3780d67 commit da1ac6b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@
2222

2323
+ (void)recordNativeError:(NSError *)error;
2424

25+
+ (void)log:(nonnull NSString *)msg;
26+
27+
+ (void)setCustomValue:(nullable id)value forKey:(nonnull NSString *)key;
28+
2529
@end

packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ + (void)recordNativeError:(NSError *)error {
2525
[[FIRCrashlytics crashlytics] recordError:error];
2626
}
2727

28+
+ (void)log:(nonnull NSString *)msg {
29+
[[FIRCrashlytics crashlytics] log:msg];
30+
}
31+
32+
+ (void)setCustomValue:(nullable id)value forKey:(nonnull NSString *)key {
33+
[[FIRCrashlytics crashlytics] setCustomValue:value forKey:key];
34+
}
35+
2836
@end

0 commit comments

Comments
 (0)