- Notifications
You must be signed in to change notification settings - Fork1.7k
Firebase SDK for Apple App Development
License
firebase/firebase-ios-sdk
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository contains the source code for all Apple platform Firebase SDKs except FirebaseAnalytics.
Firebase is an app development platform with tools to help you build, grow, andmonetize your app. More information about Firebase can be found on theofficial Firebase website.
See the subsections below for details about the different installation methods. Whereavailable, it's recommended to install any libraries with aSwift suffix to get thebest experience when writing your app in Swift.
For instructions on the standard pod install, visit:https://firebase.google.com/docs/ios/setup.
Instructions forSwift Package Manager support can befound in theSwiftPackageManager.md Markdown file.
These instructions can be used to access the Firebase repo at other branches,tags, or commits.
Seethe Podfile Syntax Referencefor instructions and options about overriding pod source locations.
All official releases are tagged in this repo and available via CocoaPods. To access a localsource snapshot or unreleased branch, use Podfile directives like the following:
To access FirebaseFirestore via a branch:
pod'FirebaseCore',:git=>'https://github.com/firebase/firebase-ios-sdk.git',:branch=>'main'pod'FirebaseFirestore',:git=>'https://github.com/firebase/firebase-ios-sdk.git',:branch=>'main'
To access FirebaseMessaging via a checked-out version of the firebase-ios-sdk repo:
pod'FirebaseCore',:path=>'/path/to/firebase-ios-sdk'pod'FirebaseMessaging',:path=>'/path/to/firebase-ios-sdk'
Instructions for the experimental Carthage distribution can be found atCarthage.md.
For details on using Firebase from a Framework or a library, refer tofirebase_in_libraries.md.
To develop Firebase software in this repository, ensure that you have at leastthe following software:
- Xcode 16.2 (or later)
CocoaPods is still the canonical way to develop, but much of the repo now supportsdevelopment with Swift Package Manager.
Install the following:
- CocoaPods 1.12.0 (or later)
- CocoaPods generate
For the pod that you want to develop:
podgenFirebase{namehere}.podspec --local-sources=./ --auto-open --platforms=ios
Note: If the CocoaPods cache is out of date, you may need to runpod repo update before thepod gen command.
Note: Set the--platforms option tomacos ortvos to develop/test forthose platforms. Since 10.2, Xcode does not properly handle multi-platformCocoaPods workspaces.
Firestore has a self-contained Xcode project. SeeFirestore/README Markdown file.
pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios- Check the Mac box in the App-iOS Build Settings
- Sign the App in the Settings Signing & Capabilities tab
- Click Pods in the Project Manager
- Add Signing to the iOS host app and unit test targets
- Select the Unit-unit scheme
- Run it to build and test
Alternatively, disable signing in each target:
- Go to Build Settings tab
- Click
+ - Select
Add User-Defined Setting - Add
CODE_SIGNING_REQUIREDsetting with a value ofNO
- To enable test schemes:
./scripts/setup_spm_tests.sh open Package.swiftor double clickPackage.swiftin Finder.- Xcode will open the project
- Choose a scheme for a library to build or test suite to run
- Choose a target platform by selecting the run destination along with the scheme
Refer toAddNewPod Markdown file for details.
For information about managing headers and imports, seeHeadersImports Markdown file.
To ensure that the code is formatted consistently, run the script./scripts/check.shbefore creating a pull request (PR).
GitHub Actions will verify that any code changes are done in a style-compliantway. Installclang-format andmint:
brew install clang-format@21brew install mint
Select a scheme and press Command-u to build a component and run its unit tests.
To run the sample apps and integration tests, you'll need a validGoogleService-Info.plist file. The Firebase Xcode project contains dummy plistfiles without real values, but they can be replaced with real plist files. To get your ownGoogleService-Info.plist files:
- Go to theFirebase Console
- Create a new Firebase project, if you don't already have one
- For each sample app you want to test, create a new Firebase app with the sample app's bundleidentifier (e.g.,
com.google.Database-Example) - Download the resulting
GoogleService-Info.plistand add it to the Xcode project.
For coverage report generation instructions, seescripts/code_coverage_report/README Markdown file.
See the sections below for any special instructions for those components.
See theFirebase AI Logic README for instructionsabout building and testing the SDK.
For specific Firebase Auth development, refer to theAuth Sample README for instructions aboutbuilding and running the FirebaseAuth pod along with various samples and tests.
The Firebase Database Integration tests can be run against a locally running Database Emulatoror against a production instance.
To run against a local emulator instance, invoke./scripts/run_database_emulator.sh start beforerunning the integration test.
To run against a production instance, provide a validGoogleServices-Info.plist and copy it toFirebaseDatabase/Tests/Resources/GoogleService-Info.plist. Your Security Rule must be set topublic while your tests arerunning.
Firebase Dynamic Links isdeprecated and should not be used in new projects. The service will shut down on August 25, 2025.
Please see ourDynamic Links Deprecation FAQ documentation for more guidance.
For specific Firebase Performance Monitoring development, seethe Performance README for instructions about building the SDKandthe Performance TestApp README for instructions aboutintegrating Performance with the dev test App.
To run the Storage Integration tests, follow the instructions inStorageIntegration.swift.
Push notifications can only be delivered to specially provisioned App IDs in the developer portal.In order to test receiving push notifications, you will need to:
- Change the bundle identifier of the sample app to something you own in your Apple Developeraccount and enable that App ID for push notifications.
- You'll also need toupload your APNs Provider Authentication Key or certificate to theFirebase ConsoleatProject Settings > Cloud Messaging > [Your Firebase App].
- Ensure your iOS device is added to your Apple Developer portal as a test device.
The iOS Simulator cannot register for remote notifications and will not receive push notifications.To receive push notifications, follow the steps above and run the app on a physical device.
Firebase provides official beta support for macOS, Catalyst, and tvOS. visionOS and watchOSare community supported. Thanks to community contributions for many of the multi-platform PRs.
At this time, most of Firebase's products are available across Apple platforms. There are stilla few gaps, especially on visionOS and watchOS. For details about the current support matrix, seethis chartin Firebase's documentation.
Where supported, visionOS works as expected with the exception of Firestore via Swift PackageManager where it is required to use the source distribution.
To enable the Firestore source distribution, quit Xcode and open the desiredproject from the command line with theFIREBASE_SOURCE_FIRESTORE environmentvariable:open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj.To go back to using the binary distribution of Firestore, quit Xcode and openXcode like normal, without the environment variable.
Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, andwork on watchOS. See theIndependent Watch App Sample.
Keep in mind that watchOS is not officially supported by Firebase. While we can catch basic unittest issues with GitHub Actions, there may be some changes where the SDK no longer works as expectedon watchOS. If you encounter this, pleasefile an issue.
During app setup in the console, you may get to a step that mentions something like "Checking if theapp has communicated with our servers". This relies on Analytics and will not work on watchOS.It's safe to ignore the message and continue, the rest of the SDKs will work as expected.
- watchOS has limited support. Due to watchOS restrictions, mach exceptions and signal crashes arenot recorded. (Crashes in SwiftUI are generated as mach exceptions, so will not be recorded)
Thanks to contributions from the community,FirebaseCombineSwift contains support for Apple's Combineframework. This module is currently under development and not yet supported for use in productionenvironments. For more details, please refer to thedocs.
SeeRoadmap for more about the Firebase Apple SDK Open Sourceplans and directions.
SeeContributing for more information on contributing to the FirebaseApple SDK.
The contents of this repository are licensed under theApache License, version 2.0.
Your use of Firebase is governed by theTerms of Service for Firebase Services.
About
Firebase SDK for Apple App Development
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.