On this page14 sections
  1. Prerequisites
  2. Learning Objectives
  3. 1. Find the Bundle ID
  4. 2. Register the iOS App
  5. 3. Add the File in Xcode
  6. 4. Deployment Target
  7. 5. Optional Info.plist Keys
  8. Code Examples
  9. Common Beginner Mistakes
  10. Best Practices
  11. Practice Questions
  12. Practice Answers
  13. Key Takeaways
  14. Full Code (Copy-Paste Reference)

Lecture 003: Adding the iOS App

Category1: Firebase Setup
Lecture003 of 014
Estimated video length14 min
TargetFlutter 3.44 · Dart 3.12 · FlutterFire (latest) · Xcode 26
LevelIntermediate

The same Firebase project serves iOS too. We register the iOS app, add its config file in Xcode, and set the minimum iOS version.

Contents

Prerequisites · Objectives · Lesson · Code Examples · Common Mistakes · Best Practices · Practice Questions · Answers · Takeaways · Full Code


Prerequisites

Lecture 001: the Firebase project. A Mac with Xcode installed.


Learning Objectives

  • Find the iOS bundle ID
  • Register the iOS app in Firebase
  • Add GoogleService-Info.plist to the Runner target in Xcode
  • Set the iOS deployment target
  • Know which Info.plist keys are optional

1. Find the Bundle ID

iOS identifies an app by its bundle ID. Open ios/Runner.xcworkspace in Xcode → select Runner (the blue project icon) → Signing & Capabilities → Bundle Identifier.

It is usually the same as the Android package name: com.example.notify_demo. Set your real one now.

2. Register the iOS App

  1. Firebase console → Project overview → Add app → the iOS+ icon.
  2. Enter the bundle ID exactly as in Xcode.
  3. Register app → Download GoogleService-Info.plist.
  4. Skip the remaining steps: the Swift package and code they show are for native apps. The FlutterFire packages do this for you.

3. Add the File in Xcode

The file must be added through Xcode, not just copied in Finder, so it is included in the build:

  1. In Xcode's left panel, right-click the Runner folder → Add Files to "Runner"…
  2. Pick GoogleService-Info.plist.
  3. Tick Copy items if needed and make sure the Runner target is ticked.
  4. Add.

It now sits in ios/Runner/GoogleService-Info.plist.

4. Deployment Target

Current Firebase versions need iOS 15 or later. Set it in two places:

  • Xcode → Runner target → General → Minimum Deployments → 15.0
  • ios/Podfile, top line:
ruby
platform :ios, '15.0'

5. Optional Info.plist Keys

You'll see this key in some guides:

xml
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>

It allows plain-http connections to local network addresses: the iOS twin of Android's usesCleartextTraffic. Firebase doesn't need it; add it only if your app talks to a local http:// server while testing.


Code Examples

Example 1: Build for iOS

bash
cd ios
pod install --repo-update
cd ..
flutter run -d "iPhone 17 Pro"

pod install downloads the native Firebase libraries the FlutterFire packages will need. The app should start in the simulator as before.


Common Beginner Mistakes

1. File copied in Finder only: it's in the folder but not in the build. Firebase then fails with "Could not locate configuration file: 'GoogleService-Info.plist'". Add it via Xcode.

2. Bundle ID mismatch: the ID in Firebase must equal Xcode's Bundle Identifier exactly.

3. Old deployment target: pod install fails with "required a higher minimum deployment target". Raise both the Podfile and Xcode settings.


Best Practices

  • Use the same identifier for Android and iOS when you can: it keeps things simple.
  • Open Runner.xcworkspace, never Runner.xcodeproj, when CocoaPods are in use.
  • Commit the Podfile change so the whole team builds with the same target.

Practice Questions

  1. Where do you find the iOS bundle ID?
  2. Why must GoogleService-Info.plist be added through Xcode?
  3. What minimum iOS version do current Firebase versions need?
  4. Does Firebase need NSAllowsLocalNetworking?

Practice Answers

  1. Xcode → Runner target → Signing & Capabilities → Bundle Identifier.
  2. So it's part of the Runner target and copied into the app.
  3. iOS 15.
  4. No: only for plain-http local servers.

Key Takeaways

  • Register the iOS app with the exact bundle ID.
  • Add GoogleService-Info.plist to the Runner target via Xcode.
  • Set iOS 15+ in Xcode and the Podfile, then pod install.
  • App Transport Security keys are for local http servers, not Firebase.

Full Code (Copy-Paste Reference)

No Dart code yet: the only file to copy is the Podfile line.

ios/Podfile (top line)

ruby
platform :ios, '15.0'

That, plus GoogleService-Info.plist added to the Runner target through Xcode (Section 3), completes the native iOS side. Firebase.initializeApp() on the Dart side arrives in Lecture 004.