Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Feature - Firebase Analytics & Crashlytics #236

Merged
merged 5 commits into from Apr 10, 2020

Conversation

workerbee22
Copy link
Collaborator

Initial implementation of Firebase Analytics (data is also passed to Google Analytics) and Firebase Crashlytics for crash & error reporting. Note this is just the initial implementation.

Changes

  • Firebase Analytics setup for iOS and Android
  • Firebase Crashlytics setup for iOS and Android for uncaught, Flutter and Crashlytics trapped errors
  • Analytics flagging each screen in the app as a screen, using constants and separate to navigation observer to ensure maintainable data in analytics as the app changes.

Screenshots

No UI changes.

Things to note

  • Release notes not updated as no user facing changes.
  • Analytics event method is present but not yet applied to event like playing PPE videos
  • Firebase console and Google Analytics console setup also accompany this PR.
  • Removed an orphan/duplicate file

lib/constants.dart Show resolved Hide resolved
lib/utils/firebase.dart Outdated Show resolved Hide resolved
lib/utils/firebase.dart Outdated Show resolved Hide resolved
lib/view/airway/checklist/intubation_checklist_page.dart Outdated Show resolved Hide resolved
lib/main.dart Outdated Show resolved Hide resolved
@lukesleeman
Copy link
Contributor

I've tested the branch out, and it appears to have no ill effects. Kind of hard to tell if its doing anything or not 😁

@workerbee22
Copy link
Collaborator Author

workerbee22 commented Apr 10, 2020

@lukesleeman Yep, until there is some data, it's a nice to have thing.

But using the simulation code (in there but commented out) one crash type at a time and setting Crashlytics.instance.enableInDevMode = true you can see the crashes locally on your console.

So I've tested all 3 levels of crash locally on Android and iOS for the simulations. Just waiting on crash data to show up in the console ... but its been a while so will go back and check. But if the app isn't talking to Crashlytics then when you goto the Firebase console you only get the setup wizard'. So because we can see the proper Crashlytics console view the app MUST have talked to Crashlytics already.

Copy link
Collaborator

@sallychung sallychung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working. Tested through Proxyman

image

ios/Runner.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
@maks
Copy link
Collaborator

maks commented Apr 10, 2020

So I've tested all 3 levels of crash locally on Android and iOS for the simulations. Just waiting on crash data to show up in the console ... but its been a while so will go back and check. But if the app isn't talking to Crashlytics then when you goto the Firebase console you only get the setup wizard'. So because we can see the proper Crashlytics console view the app MUST have talked to Crashlytics already.

@workerbee22 So I'd feel much better once we can actual app generated errors, especially app crashes in the console 🙂
as this is exactly what I experienced previously trying and failing to use Crashlytics in a Flutter app: everything looked fine locally but nothing ever showed up in the web console...

@workerbee22
Copy link
Collaborator Author

I'll do a check against the project for which I provided the screen shots ie. these. Perhaps I missed something:

Issue: #15

image

@workerbee22 workerbee22 linked an issue Apr 10, 2020 that may be closed by this pull request
lib/utils/firebase.dart Outdated Show resolved Hide resolved
@yimingc2
Copy link
Contributor

Looks good to me! Appreciate for your effort to make it happen!

@workerbee22
Copy link
Collaborator Author

OK so nothing in the console yet for Crashlytics from my tests ... investigating.

Analytics data coming through fine.

@lukesleeman lukesleeman added this to In review in Kanban Apr 10, 2020
@workerbee22
Copy link
Collaborator Author

OK PR workflow build all OK. Merging this one.

@workerbee22 workerbee22 requested a review from maks April 10, 2020 11:00
@workerbee22 workerbee22 merged commit de5e341 into master Apr 10, 2020
Kanban automation moved this from In review to QA Apr 10, 2020
@workerbee22 workerbee22 deleted the feature/add-analytics-crashreporting branch April 10, 2020 11:15
@workerbee22 workerbee22 moved this from QA to Done in Kanban Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Engineering Enhancement New feature or request
Projects
Kanban
  
Done
Development

Successfully merging this pull request may close these issues.

Need to add tool for Crash Reporting & Analytics
5 participants