0
0
Firebasecloud~10 mins

Crash reporting in Firebase - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize Firebase Crashlytics in your app.

Firebase
FirebaseCrashlytics [1] = FirebaseCrashlytics.getInstance();
Drag options to blanks, or click blank then click option'
Ainitialize
Bsetup
Ccrashlytics
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using method names instead of variable names
Forgetting to assign the instance to a variable
2fill in blank
medium

Complete the code to log a custom message to Crashlytics.

Firebase
crashlytics.[1]("User clicked the button");
Drag options to blanks, or click blank then click option'
Atrack
Blog
Csend
Dreport
Attempts:
3 left
💡 Hint
Common Mistakes
Using report or send which are not valid methods
Using track which is not a Crashlytics method
3fill in blank
hard

Fix the error in the code to record a non-fatal exception in Crashlytics.

Firebase
crashlytics.[1](new Exception("Network error"));
Drag options to blanks, or click blank then click option'
ArecordException
BsendException
ClogException
DcaptureException
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like sendException
Confusing with logging methods
4fill in blank
hard

Fill both blanks to set a user identifier and enable Crashlytics collection.

Firebase
crashlytics.[1]("user_123");
crashlytics.[2](true);
Drag options to blanks, or click blank then click option'
AsetUserId
BsetUser
CsetCrashlyticsCollectionEnabled
DenableCrashlytics
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names like setUser
Using enableCrashlytics which does not exist
5fill in blank
hard

Fill all three blanks to record a custom key, log a message, and force a crash.

Firebase
crashlytics.[1]("last_screen", "Home");
crashlytics.[2]("App crashed due to unexpected input");
crashlytics.[3]();
Drag options to blanks, or click blank then click option'
AsetCustomKey
Blog
Ccrash
DrecordException
Attempts:
3 left
💡 Hint
Common Mistakes
Using recordException instead of crash to force a crash
Mixing up method names