setup static method

void setup({
  1. SimplyticsAnalyticsInterface? analyticsService,
  2. SimplyticsCrashlogInterface? crashlogService,
})

Set up analytics and error monitoring object instances. Must be called before sending events to analytics and error reporting.

You can set up only one service, for example only the error monitoring service, if you do not need analytics.

It is possible to configure several services of the same type at once using a group class, for example:

Simplytics.setup(
  crashlogService: SimplyticsCrashlogServiceGroup([
    SimplyticsDebugCrashlogService(),
    CustomCrashReportingService(),
  ]),
);

See also:

Implementation

static void setup({
  SimplyticsAnalyticsInterface? analyticsService,
  SimplyticsCrashlogInterface? crashlogService,
}) {
  if (analyticsService != null) {
    _analytics = analyticsService;
  }
  if (crashlogService != null) {
    _crashlog = crashlogService;
  }
}