Docly Child

Firebase Configuration

Estimated reading: 3 minutes

Create a Firebase project

Before you can add Firebase to your Flutter app, you need to create a Firebase project to connect to your app. Visit Understand Firebase Projects to learn more about Firebase projects.

Important:

If you're releasing your Flutter app on both iOS and Android, register both the iOS and Android versions of your app with the same Firebase project.
Visit for more information on how to setup for Android
Visit for more information on how to setup for iOS

Register your app with Firebase

Important:

Make sure that you enter the ID that your app is actually using. You cannot add or modify this value after you register your app with your Firebase project. Both applicationId should be matched.
  • Click Register app.
 

Add a Firebase configuration file

  • Click Download google-services.json to obtain your Firebase Android config file (google-services.json).
  • Move your config file into the android/app directory of your Flutter app.

Follow the instruction for enabling Firebase services in your Android app here

Enable the Google, Phone and Apple SignIn

  • In Firebase console, open the Authentication section.
  • On the Sign-in Method tab, enable the Google Sign method and click save same as Apple and Phone signIn method.
  • Add your debug and release SHA1 Key. Follow this link .

Enable Firebase Notification in Mobile for both Android and IOS

  • Firstly, go to the Admin Panel, select the App option -> Notification in the left sidebar
  • Add your Firebase Web API Key ( Server Key ) and click on Save Changes.

For Server Key

  • Click on  Project Overview  –> Settings – Cloud Messaging 
  • In Cloud Messaging API (Legacy), click the three dots and select “Manage in Google Cloud Console.” After the page is successfully redirected, open the Firebase Console again and Refresh the Cloud Messaging tab to find the Server Key, copy that key and set it in Admin Panel.
  • After enable it, Firebase Notification is working!
 For IOS :
  • Login into Firebase and select the your project
  • Go to the Project Settings and select the Cloud Messaging section
  • Scroll down and you can show Apple app configuration section and select your iOS build identifiers which you have used for the Specific App
  • You can get Upload APNs Certificates popup and drag or select your support.p12 certificate

 

  • After that add the below code in AppDelegate.swift file under ios folder in your project
if #available(iOS 10.0, *) {
  UNUserNotificationCenter.current().delegate
  = self as? UNUserNotificationCenterDelegate
}
 

Leave a Comment

Share this Doc
CONTENTS