简体   繁体   中英

Crashlytics log exception

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM