Coder Social home page Coder Social logo

rashmisridar / bugsnag-crashlytics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moujarkash/bugsnag-crashlytics

0.0 0.0 0.0 4.85 MB

A Flutter plugin to use the Bugsnag Crashlytics Service.

License: MIT License

Kotlin 19.03% Swift 17.44% Objective-C 4.48% Dart 45.70% Ruby 13.36%

bugsnag-crashlytics's Introduction

bugsnag_crashlytics plugin

A Flutter plugin to use the Bugsnag Crashlytics Service.

Usage

Use the plugin

Add the following imports to your Dart code:

import 'package:bugsnag_crashlytics/bugsnag_crashlytics.dart';

Setup Crashlytics:

void main() {
  
  // pass your key api of bugsnag to the plugin to setup
  BugsnagCrashlytics.instance.register(androidApiKey: "ANDROID_API_KEY", iosApiKey: "IOS_API_KEY", releaseStage: 'RELEASE_STAGE', appVersion: 'APP_VERSION');
  
  // Pass all uncaught errors from the framework to Crashlytics.
  FlutterError.onError = BugsnagCrashlytics.instance.recordFlutterError;
  
  runApp(MyApp());
}

Overriding FlutterError.onError with BugsnagCrashlytics.instance.recordFlutterError will automatically catch all errors that are thrown from within the Flutter framework.
If you want to catch errors that occur in runZoned, you can supply BugsnagCrashlytics.instance.recordError to the onError parameter:

runZoned<Future<void>>(() async {
    // ...
  }, onError: BugsnagCrashlytics.instance.recordError);

Result

If an error is caught, you should see the following messages in your logs:

flutter: Flutter error caught by Crashlytics plugin:
// OR if you use recordError for runZoned:
flutter: Error caught by Crashlytics plugin <recordError>:
// Exception, context, information, and stack trace in debug mode
// OR if not in debug mode:
flutter: Error reported to Crashlytics.

Note: It may take awhile (up to 24 hours) before you will be able to see the logs appear in your Bugsnag console.

bugsnag-crashlytics's People

Contributors

moujarkash avatar strepier avatar hugotiem avatar landonmr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.