9

In my ios app I'm catching a crash but I still want it to log in crashlytics so that I'm aware of it. On Android (Java) devices I can run Crashlytics.logException but I'm not seeing anything like that for objectiveC. I've searched google for how to do this but I'm not finding anything helpful. Does anyone have any experience with doing this with crashlytics on iOS devices?

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284

2 Answers2

1

Anything you log using Crashlytics is only sent to the server when an actual crash occurs. Unfortunately, it doesn't support sending logs to the service without a crash. You might want to create an API in your backend for this or use another service like Flurry or Mixpanel to get some metrics around when your exception is occurring.

badAPI
  • 122
  • 3
1

In try-catch block use the below catch block

@try {
// line of code here
}
@catch (NSException *exception) {
NSUncaughtExceptionHandler *handler = NSGetUncaughtExceptionHandler();
handler(exception);
}

as explained at http://support.crashlytics.com/knowledgebase/articles/222764-can-i-use-a-custom-exception-handler

Aanabidden
  • 375
  • 6
  • 18
  • Did you initialised crashlytics in applicationdidfinishlaunching @Awesome-o check by setting debug as yes what is the status of crashlytics – Aanabidden Sep 01 '15 at 19:32
  • Yup and been using Crashlytics for quite a while now with success. This is just the first time I've tried it with caught exceptions, but I'm running from the simulator. Going to try it on the device and see what happens. – Awesome-o Sep 01 '15 at 19:37