Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Features Suggestion #124

Closed
TheAmanM opened this issue Aug 21, 2022 · 6 comments
Closed

Firebase Features Suggestion #124

TheAmanM opened this issue Aug 21, 2022 · 6 comments
Labels
enhancement New feature or request stale

Comments

@TheAmanM
Copy link
Contributor

TheAmanM commented Aug 21, 2022

@KalleHallden It might be a good idea to implement Firebase Crashlytics and Performance monitoring. These will give you good insight about your app on the Firebase console.

Here is some sample code for implementing Crashlytics, it looks pretty simple:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp();

  // Pass all uncaught errors from the framework to Crashlytics.
  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

  runApp(MyApp());
}
@KalleHallden KalleHallden added the enhancement New feature or request label Aug 21, 2022
@KalleHallden KalleHallden added this to the Smaller features milestone Aug 21, 2022
@jorre127
Copy link
Contributor

in addition to this we should probably also put the content of the main into a runeZonedGuard and catch and report the errors to firebase crashlytics.

@KalleHallden
Copy link
Collaborator

@all-contributors please add @TheAmanM for code, maintenance and

@allcontributors
Copy link
Contributor

@KalleHallden

I've put up a pull request to add @TheAmanM! 🎉

@TheAmanM
Copy link
Contributor Author

Good point on the runZoneGuarded. The code, according to Firebase documentation should then be:

void main() async {
  runZonedGuarded<Future<void>>(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();

    FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

    runApp(MyApp());
  }, (error, stack) =>
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true));
}

Also @jorre127, how do you know so much about Flutter? Where do you learn everything from?

@jorre127
Copy link
Contributor

@TheAmanM I work for a company that makes flutter apps, so that helps a lot haha. Just by coming into contact with it everyday I guess.

@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the stale label Sep 21, 2022
@stale stale bot closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants