app_center_connect 0.0.1 copy "app_center_connect: ^0.0.1" to clipboard
app_center_connect: ^0.0.1 copied to clipboard

PlatformAndroidiOS
unlisted

App Center analytics and crashes for Flutter

VS App Center Connect Plugin for Flutter #

Code Quality and Tests

This is plugin currently bundles appcenter analytics, crashes.

To get started, go to AppCenter and register your apps.

For detailed AppCenter API reference, go to https://aka.ms/appcenterdocs

Develop by FEDANDBURK LIMITED Company

Usage #

Global #

import 'package:app_center_connect/app_center_connect.dart';

Implementation #

await AppCenterConnect.start(
    appSecretAndroid: androidSecretKey, appSecretIOS: iOSSecretKey,
);

Enabling or disabling services #

await AppCenterConnect.configureAnalytics(enabled: true);

await AppCenterConnect.configureCrashes(enabled: true);

Track events #

await AppCenterConnect.trackEvent('SomeEvent');

await AppCenterConnect.trackEvent('SomeEvent', {'properties':'value'}); // with custom properties

Track Crashes #

await AppCenterConnect.trackError(
        error,
        properties: {'properties':'value'}, // optional
        stackTrace: stackTrace, // optional
    );

Configurate Crashes #

 // Log Flutter errors with FlutterError.onError
FlutterError.onError = (FlutterErrorDetails errorDetails) {
    FlutterError.presentError(errorDetails);

    // Send Flutter errors to AppCenter
    AppCenterConnect.trackError(
        error,
        properties: {'properties':'value'}, // optional
        stackTrace: stackTrace, // optional
    );
};

  // Log errors not caught by Flutter with PlatformDispatcher.instance.onError
PlatformDispatcher.instance.onError = (error, stack) {
    AppCenterConnect.trackError(
        error,
        properties: {'properties':'value'}, // optional
        stackTrace: stackTrace, // optional
    );
    return true;
};

Example #

See the example directory for a complete sample app using App Center Connect.