What is the first step to add Firebase to a React Native app using @react-native-firebase?
The first step is to install the core Firebase package with npm or yarn, for example: npm install @react-native-firebase/app.
Click to reveal answer
beginner
Why do you need to add google-services.json or GoogleService-Info.plist files in Firebase setup?
These files contain your Firebase project configuration and credentials. They connect your app to your Firebase project on Android (google-services.json) and iOS (GoogleService-Info.plist).
Click to reveal answer
intermediate
How do you link native Firebase SDKs after installing @react-native-firebase packages?
For React Native 0.60+, auto-linking handles this. For older versions, you must manually link native modules using react-native link.
Click to reveal answer
intermediate
What is the purpose of running npx pod-install in iOS Firebase setup?
It installs the native iOS Firebase dependencies using CocoaPods, ensuring the Firebase SDK is correctly integrated into the Xcode project.
Click to reveal answer
beginner
How can you verify Firebase is correctly set up in your React Native app?
You can import Firebase in your app and check if the app instance initializes without errors, for example: <code>import firebase from '@react-native-firebase/app'; console.log(firebase.app().name);</code> should print <code>[DEFAULT]</code>.
Click to reveal answer
Which command installs the core Firebase package for React Native?
Anpm install @react-native-firebase/app
Bnpm install firebase
Cnpm install react-native-firebase
Dnpm install firebase-core
✗ Incorrect
The official package for Firebase in React Native is @react-native-firebase/app.
Where do you place the google-services.json file in an Android React Native project?
Aandroid/src/
Bandroid/
Candroid/app/
Dandroid/app/src/main/
✗ Incorrect
The google-services.json file goes inside the android/app/src/main/ folder.
What tool manages iOS Firebase dependencies in React Native?
Anpm
BCocoaPods
CGradle
DYarn
✗ Incorrect
CocoaPods manages native iOS dependencies, including Firebase SDKs.
What does npx pod-install do?
AInstalls iOS native dependencies via CocoaPods
BRuns the React Native app
CInstalls Android dependencies
DBuilds the JavaScript bundle
✗ Incorrect
npx pod-install installs iOS native dependencies using CocoaPods.
How do you check if Firebase initialized correctly in your React Native app?
ALook for <code>firebase.json</code> file
BRun <code>firebase init</code>
CCheck if <code>firebase.app().name</code> returns '[DEFAULT]'
DCheck AndroidManifest.xml
✗ Incorrect
Calling firebase.app().name returns '[DEFAULT]' if Firebase initialized properly.
Explain the steps to set up Firebase in a React Native app using @react-native-firebase.
Think about installation, configuration files, native setup, and verification.
You got /5 concepts.
Why is it important to add platform-specific Firebase config files in your React Native project?
Consider how Firebase knows which project your app belongs to.
You got /5 concepts.
Practice
(1/5)
1. What is the first package you should install to start using Firebase in a React Native app with @react-native-firebase?
easy
A. Install @react-native-firebase/firestore
B. Install @react-native-firebase/app
C. Install @react-native-firebase/database
D. Install @react-native-firebase/auth
Solution
Step 1: Understand Firebase core setup
The core Firebase package @react-native-firebase/app is required first to initialize Firebase in the app.
Step 2: Identify specific packages
Other packages like auth, database, or firestore are added later depending on features needed.
Hint: Use exact package name with @react-native-firebase prefix [OK]
Common Mistakes:
Using 'firebase' instead of '@react-native-firebase/app'
Missing the '@' symbol in package name
Installing unrelated packages
3. Given this React Native code snippet, what will be the output when Firebase is correctly initialized?
import firebase from '@react-native-firebase/app';
console.log(firebase.app().name);
medium
A. [DEFAULT]
B. undefined
C. null
D. firebase
Solution
Step 1: Understand firebase.app() method
The firebase.app() method returns the default Firebase app instance.
Step 2: Check the default app name
The default app instance has the name "[DEFAULT]" unless otherwise configured.
Final Answer:
[DEFAULT] -> Option A
Quick Check:
firebase.app().name = [DEFAULT] [OK]
Hint: Default Firebase app name is always '[DEFAULT]' unless changed [OK]
Common Mistakes:
Expecting undefined or null instead of '[DEFAULT]'
Confusing app name with package name
Assuming firebase.app() returns a config object
4. You installed @react-native-firebase/app and added your GoogleService-Info.plist file for iOS, but Firebase still doesn't initialize. What is the most likely missing step?
medium
A. Running pod install inside the ios directory
B. Running npm install again
C. Restarting the React Native packager
D. Adding firebase.json file
Solution
Step 1: Recognize iOS native dependency linking
After adding Firebase config files on iOS, you must run pod install to link native modules.
Step 2: Understand why pod install is needed
This installs CocoaPods dependencies required for Firebase to work on iOS.
Final Answer:
Running pod install inside the ios directory -> Option A
Quick Check:
iOS native linking requires pod install [OK]
Hint: Always run pod install after adding iOS Firebase config [OK]
Common Mistakes:
Forgetting to run pod install after adding plist
Assuming npm install is enough for iOS native modules
Not restarting Xcode or build after changes
5. You want to add Firebase Authentication to your React Native app using @react-native-firebase. Which steps must you follow to set it up correctly?
hard
A. Install @react-native-firebase/app and @react-native-firebase/auth, no need for config files
B. Only install @react-native-firebase/auth and start using it directly
C. Add config files and run pod install, no need to install auth package
D. Install @react-native-firebase/app and @react-native-firebase/auth, add config files, run pod install (iOS), then import and use auth module
Solution
Step 1: Install required packages
You must install both @react-native-firebase/app (core) and @react-native-firebase/auth (auth feature).
Step 2: Add platform config files and run pod install
Include GoogleService-Info.plist for iOS and google-services.json for Android, then run pod install on iOS.
Step 3: Import and use the auth module in your code
After setup, import auth from @react-native-firebase/auth and use its methods.
Final Answer:
Install @react-native-firebase/app and @react-native-firebase/auth, add config files, run pod install (iOS), then import and use auth module -> Option D
Quick Check:
Full Firebase auth setup = install + config + pod install + import [OK]
Hint: Install core and auth packages, add configs, run pod install [OK]
Common Mistakes:
Skipping config files after installing auth package
Not running pod install on iOS
Trying to use auth without installing its package
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.