Firebase Authentication Setup for iOS & Android
π§ Skip Auth logic to test app without it
Still setting up Firebase Auth? You can skip the sign-in screen and test your app by setting:
// (mobile)/router.tsx
const isSignedInTest = true;
Create a Firebase project
To set up authorization, start by creating a new project in Firebase:
Go your project on Firebase (opens in a new tab) and create a new project.

Update values in .env.local
Take these Firebase Auth config values and paste them in your .env.local


iOS Setup
Rename your app before setting up Firebase Authorization for iOS.
1. Register your iOS app
In the Firebase console:
- Click Add App β Select iOS
- Enter your iOS Bundle ID (e.g.
com.yourcompany.yourapp
) - (Optional) Add an App nickname
- Click Register App

2. Download the Firebase config file
Once your iOS app is registered:
- Click Download
GoogleService-Info.plist
- Save it locally β you'll need it in Xcode

3. Open iOS project in Xcode
Run the following command:
npx cap open ios
4. Add the config to your project
- Drag & drop the GoogleService-Info.plist into Xcode
- Select βCopy items if neededβ
- Place it in the root of the app target folder

5. Install Firebase SDK via Swift Package Manager
- In Xcode: File β Add Packages
- Paste:
https://github.com/firebase/firebase-ios-sdk
- Select only the modules you need (e.g. FirebaseAuth)
- Click Add Package

6. Enable Google Sign-In
- Go to Authentication β Sign-in method
- Enable Google
- Save
π Re-download GoogleService-Info.plist and replace the old one
7. Enable Apple Sign-In
- Go to Authentication β Sign-in method
- Enable Apple
- Save
8. Configure Custom URL Scheme
- In Xcode, open project settings
- Select your app under Targets
- Go to Info β URL Types
- Click β and add a new entry
- In URL Schemes, paste your REVERSED_CLIENT_ID
(found in GoogleService-Info.plist) 6. Leave other fields empty
This step enables Google login redirect to work
9. Test Login Flow
You can now call:
import { FirebaseAuthentication } from "@capacitor-firebase/authentication";
await FirebaseAuthentication.signInWithGoogle();
// or
await FirebaseAuthentication.signInWithApple();
Sign out:
await FirebaseAuthentication.signOut();
You can use SignInScreen.tsx component where all of these is done. It's going to be run by default.
Android Setup
Add a new Android app
In the Firebase console:
- Click Add App β Select Android
- Enter your appβs Package name (e.g.
com.nextnative.yourapp
) - (Optional) Add app nickname
- Click Register app
Download & place config file
- Download the
google-services.json
file - Place it in:
android/app/google-services.json
Enable Google Sign-In
In Firebase Console:
- Go to Authentication β Sign-in method
- Enable Google
- Save
Sign in with Google
Use the Capacitor plugin to trigger login:
import { FirebaseAuthentication } from "@capacitor-firebase/authentication";
await FirebaseAuthentication.signInWithGoogle();
Sign out:
await FirebaseAuthentication.signOut();
Test on real Android device
npx cap open android
Use a physical device with Google Play Services. Most emulators donβt support this.