MacOS Installation
Notice
This page is archived and might not reflect the latest version of the FlutterFire plugins. With the latest plugins, manual installation is not required. You can find the latest information on firebase.google.com:
Before using FlutterFire on MacOS, you must first connect to your Firebase project with your MacOS application.
#
Generating a Firebase project configuration fileOn the Firebase Console, add a new iOS app or select an
existing iOS app for your Firebase project. The "iOS bundle ID" must match your local project bundle ID for your MacOS application. The bundle ID
can be found within the "General" tab when opening macos/Runner.xcworkspace
with Xcode.
Download the GoogleService-Info.plist
file for the Firebase app.
#
Installing your Firebase configuration fileNext you must add the file to the project using Xcode (adding manually via the filesystem won't link the file to the
project). Using Xcode, open the project's macos/{projectName}.xcworkspace
file. Right click Runner
from the left-hand
side project navigation within Xcode and select "Add files", as seen below:
Select the GoogleService-Info.plist
file you downloaded, and ensure the "Copy items if needed" checkbox is enabled:
#
Setting up entitlementsIt is important you setup entitlements.
Failure to setup will result in network errors. You will not be able to connect to services such as any Firebase Emulator.
#
Enabling use of Firebase Emulator SuiteThe Firebase Emulator Suite uses un-encrypted networking connections in order to enable fast, uncomplicated setup. However macOS by default requires encrypted networking connections. If you would like to use any part of the Firebase Emulator Suite to emulate firebase services on your local machine during development, you must allow your macOS app to connect to local network services over insecure connections.
To allow insecure connections, we recommend adding the NSAllowsLocalNetworking
key to the NSAppTransportSecurity
dictionary in your application's plist file.
Specifically if your app is named 'MyApp', and are sharing your configuration between iOS and macOS you might add these keys in ios/MyApp/Info.plist
:
#
macOS Supported VersionsName | Deployment Target (minimum) |
---|---|
firebase_core | 10.12 |
cloud_firestore | 10.12 |
firebase_analytics | 10.12 |
firebase_app_check | 10.12 |
firebase_auth | 10.12 |
firebase_crashlytics | 10.12 |
firebase_database | 10.12 |
firebase_dynamic_links | 10.12 |
firebase_in_app_messaging | 10.12 |
firebase_messaging | 10.12 |
firebase_performance | 10.12 |
firebase_remote_config | 10.12 |
firebase_storage | 10.12 |
Please see the underlying firebase-ios-sdk for further details.