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?
Asked
Active
Viewed 1,140 times
9

Jacksonkr
- 31,583
- 39
- 180
- 284
-
1This is exactly the issue that I'm having. I'll post here if I find a solution. – Tanner Semerad Sep 16 '14 at 22:19
-
See http://stackoverflow.com/questions/24950777/how-can-i-get-crashlytics-to-send-a-log-to-its-server-without-that-my-app-crashe – Alex Cohn Jan 13 '15 at 10:21
-
@Tanner Check out Aanabidden's answer below, he just added that today and it looks promising. – Jacksonkr May 12 '15 at 21:26
-
Possible duplicate of [Crashlytics iOS - log caught exception](http://stackoverflow.com/questions/23118742/crashlytics-ios-log-caught-exception) – Mike Bonnell Jan 14 '16 at 14:06
2 Answers
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