Challenge - 5 Problems
Firebase Analytics and Crashlytics Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate2:00remaining
What happens when you log an event with Firebase Analytics in Swift?
Consider this Swift code snippet that logs a custom event using Firebase Analytics. What is the expected behavior after this code runs?
iOS Swift
import FirebaseAnalytics Analytics.logEvent("purchase", parameters: ["item_id": "sku123", "price": 9.99])
Attempts:
2 left
💡 Hint
Think about how Firebase Analytics handles event logging and reporting.
✗ Incorrect
Calling Analytics.logEvent sends the event data asynchronously to Firebase Analytics. The event will appear in the Firebase console after some processing time.
❓ lifecycle
intermediate2:00remaining
When should you initialize Firebase Crashlytics in an iOS app?
You want to capture crashes in your iOS app using Firebase Crashlytics. At which point in the app lifecycle should you initialize Crashlytics to ensure it captures all crashes?
Attempts:
2 left
💡 Hint
Crashlytics needs to be ready as early as possible to catch startup crashes.
✗ Incorrect
Initializing Crashlytics in application(_:didFinishLaunchingWithOptions:) ensures it starts monitoring crashes from app launch onward.
🔧 Debug
advanced2:00remaining
Why does this Crashlytics custom key not appear in the Firebase console?
You added this code to set a custom key in Crashlytics, but the key-value pair does not show up in the Firebase Crashlytics dashboard. What is the most likely reason?
iOS Swift
import FirebaseCrashlytics Crashlytics.crashlytics().setCustomValue("premium", forKey: "user_type")
Attempts:
2 left
💡 Hint
Think about when Crashlytics uploads crash reports and associated data.
✗ Incorrect
Crashlytics uploads custom keys only when a crash occurs. Without a crash, the keys are not sent or visible in the dashboard.
🧠 Conceptual
advanced2:00remaining
How does Firebase Analytics handle user privacy and data collection on iOS?
Which statement correctly describes Firebase Analytics behavior regarding user privacy on iOS devices?
Attempts:
2 left
💡 Hint
Consider Apple's privacy rules and how Firebase integrates with them.
✗ Incorrect
Firebase Analytics integrates with iOS privacy frameworks and respects user consent for tracking, disabling IDFA collection if permission is denied.
expert
2:00remaining
What is the effect of calling Crashlytics.crashlytics().crash() in your app?
You add the following line in your app code during testing. What happens when this line executes?
iOS Swift
Crashlytics.crashlytics().crash()
Attempts:
2 left
💡 Hint
This method is used to test Crashlytics crash reporting.
✗ Incorrect
Calling crash() forces the app to crash immediately, which helps test Crashlytics crash reporting functionality.