init static method
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,
Init Bugfender with the following parameteres:
appKey
- The app key to log intoapiUri
- Base URL to Bugfender APIbaseUri
- Base URL to Bugfender web dashboardmaximumLocalStorageSize
- 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 totrue
.enableUIEventLogging
- Register a handler for most common UI events to report them to Bugfender. Defaults totrue
.enableCrashReporting
Register error handler for native uncaught errors that reports a crash to Bugfender. Defaults totrue
.enableAndroidLogcatLogging
- Logs all logs written via Logcat. Defaults tofalse
.overrideDeviceName
- Sets the name for the device. If the Device Name is not set, then the device model will be automatically sent. Deprecated, preferFlutterBugfender.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,
);
}