init static method

Future<void> init(
  1. String appKey, {
  2. Uri? apiUri,
  3. Uri? baseUri,
  4. int? maximumLocalStorageSize,
  5. bool printToConsole = true,
  6. bool enableUIEventLogging = true,
  7. bool enableCrashReporting = true,
  8. bool enableAndroidLogcatLogging = false,
  9. @Deprecated('Prefer `setDeviceString()` instead') String? overrideDeviceName,
  10. String? version,
  11. String? build,
})

Init Bugfender with the following parameteres:

  • appKey - The app key to log into
  • apiUri - Base URL to Bugfender API
  • baseUri - Base URL to Bugfender web dashboard
  • maximumLocalStorageSize - Set the maximum size to store local log files, in bytes. Defaults to 5 MB (Mobile specific).
  • printToConsole - Print to console when Bugfender logging methods are called. Defaults to true.
  • enableUIEventLogging - Register a handler for most common UI events to report them to Bugfender. Defaults to true.
  • enableCrashReporting Register error handler for native uncaught errors that reports a crash to Bugfender. Defaults to true.
  • enableAndroidLogcatLogging - Logs all logs written via Logcat. Defaults to false.
  • overrideDeviceName - Sets the name for the device. If the Device Name is not set, then the device model will be automatically sent. Deprecated, prefer FlutterBugfender.setDeviceString() instead.
  • version - App version identifier (Web specific)
  • build - App build identifier (Web specific)

Implementation

static Future<void> init(
  String appKey, {
  Uri? apiUri,
  Uri? baseUri,
  int? maximumLocalStorageSize,
  bool printToConsole = true,
  bool enableUIEventLogging = true,
  bool enableCrashReporting = true,
  bool enableAndroidLogcatLogging = false,
  @Deprecated('Prefer `setDeviceString()` instead')
  String? overrideDeviceName,
  String? version,
  String? build,
}) {
  WidgetsFlutterBinding.ensureInitialized();
  return _flutterBugfenderInterface.init(
    appKey,
    apiUri: apiUri,
    baseUri: baseUri,
    maximumLocalStorageSize: maximumLocalStorageSize,
    enableAndroidLogcatLogging: enableAndroidLogcatLogging,
    enableCrashReporting: enableCrashReporting,
    enableUIEventLogging: enableUIEventLogging,
    overrideDeviceName: overrideDeviceName,
    printToConsole: printToConsole,
    version: version,
    build: build,
  );
}