So I intend to detect and trigger a firebase custom event when my app crashes, is there a recommended way to check that? I tried AppDelegate method applicationWillTerminate
but it didn't work, similarly I tried to observe through an NSSetUncaughtExceptionHandler
but again in vain. I want to know how Crashlytics or Sentry or Bugsnag do it. Any help will be more than helpful.
Asked
Active
Viewed 724 times
1

Mohsin Khubaib Ahmed
- 1,008
- 16
- 32
1 Answers
1
Whenever app is crashed it means it doesnt respond to any of the events triggered or any calls you make in your app. So if it helps you can send event parameters in the Crash log event something like this.
let keysAndValues = [
"string key" : "string value",
"string key 2" : "string value 2",
"boolean key" : true,
"boolean key 2" : false,
"float key" : 1.01,
"float key 2" : 2.02
] as [String : Any]
Crashlytics.crashlytics().setCustomKeysAndValues(keysAndValues)
Refer : https://firebase.google.com/docs/crashlytics/customize-crash-reports for more details

Deepa Bhat
- 174
- 1
- 10
-
Ahh! Thank you for the help but see this isn't really helping me in detecting a crash through my own system, infact its just adding to the crashalytics report which is not what i require. If im not using crashalytics this is of no use to me. I want to know, how to detect a crash like all the platforms that report it, i want to report it too.. via an event or sending an email to myself. – Mohsin Khubaib Ahmed Mar 24 '21 at 15:23
-
You will be notified with an email when there is a crash in your app. So that will be handled by firebase itself. – Deepa Bhat Mar 29 '21 at 14:43