Skip to content

[Crashlytics] Execute code before crash #6336

Answered by mikehardy
tominou asked this question in Q&A
Discussion options

You must be logged in to vote

This depends on where the crash is, and how much trouble you are willing to go to.

If the crash is in javascript, sure! Install a new default javascript exception handler, and configure react-native-firebase so it chains your handler instead of overriding it -

https://rnfirebase.io/app/json-config#crashlytics_javascript_exception_handler_chaining_enabled

https://invertase.io/blog/react-native-firebase-crashlytics-configuration#configurable-exception-handler-chaining

If it is a javascript crash and you want to run code first, install a global javascript exception handler that does what you need, and take care to preserve chaining so any other handlers are unaffected.

Here is an example of …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tominou
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants