androidcrashlyticscrashlytics-androidcrashlytics-beta

Using Crashlytics to send custom reports?


Currently I can only send crash reports to Fabric Crashlytics and according to this documentation, I can attach custom messages and name-value pairs to crash reports using the following code:

Crashlytics.log("Error Passing Data for User: " + user.getId());

But this only gets triggered if a crash occurs and then this data will be attached to the report.

But is it possible to send a a custom report without waiting for a crash to trigger it? Pretty much using Fabric Crashlytics as an analytics service.

For example if I want to send a message to the dashboard saying a specific method could not be called or if certain data is missing. I am trying to use it for analytics purposes for the developers to track the internal process logs.

Thanks in advance


Solution

  • Fabric provides an analytics module called answers.

    It let you track events inside your app. There are some predefined events but its also possible to define your own events with custom attributes like this:

    Answers.getInstance().logCustom(
          new CustomEvent("Error")
              .putCustomAttribute("Error Passing Data for User", user.getId())
    );
    

    Tracked events are available nearly immediately and can be analyzed inside the webinterface of fabric.