-
In the native SDK it is possible to add custom keys to the Crashlytics reports by using setCustomKey or setCustomValue. I don't see this (yet) in the react native library as far as I know. Of course I could write a bridge and send it through the native sdk, but I'm not using a bridge now and it would bring extra complexity to my app. What I want to do is send the current redux state with the crash by setting the latest state as a custom value on every state change. This way I know which state the app is in when the crash occurs. For now I'm using the logs, but that's not the way I want to go. Am I missing something or do you have other suggestions on how to handle this? https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios#add-keys |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi there! Internally, setAttribute and setAttributes are mapped to setCustomKey(s) https://rnfirebase.io/reference/crashlytics#setAttribute The code's always available to check and it's organized pretty well here, knowing the same may be useful in the future in case you need it Not sure why our API naming doesn't match up exactly yet - the project's been running for years so it's probably some historical artifact - but I noted it myself a while ago. If you wanted to add to index.d.ts / index.js a set of APIs called setAttribute/setAttributes that had the same javascript implementation, then just call the current ones from the correct naming that'd be a great PR for future folks |
Beta Was this translation helpful? Give feedback.
Hi there! Internally, setAttribute and setAttributes are mapped to setCustomKey(s)
https://rnfirebase.io/reference/crashlytics#setAttribute
react-native-firebase/packages/crashlytics/lib/index.js
Line 89 in 46556de
react-native-firebase/packages/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsModule.java
Lines 110 to 132 in 46556de