If you initialize your app without a valid set of Firebase options, new users of
your application will experience serious issues.

Firebase options are a set of parameters required by services in order to
successfully communicate with Firebase server APIs and to associate client data
with your Firebase project and Firebase application. Firebase services rely on
valid Firebase options being available from the Firebase core/common library
created during Firebase initialization.

Different Firebase services require different Firebase options to function
properly, but all Firebase services require the following Firebase options:

- **[API key](https://cloud.google.com/docs/authentication/api-keys)** - Note: this is **not** an FCM server key, see [FCM server keys](https://firebase.google.com/support/guides/init-options.md.txt#fcm_server_keys).   
  Example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`
- **[Project ID](https://firebase.google.com/docs/projects/learn-more.md.txt#project-id)** - Example value: `myapp-project-123`.
- **Application ID ("AppID")** - Unique identifier for your app whose format depends on platform:
  - For Android: `mobilesdk_app_id`---Note: **this is not an Android package name** .   
    Example value: `1:1234567890:android:321abc456def7890`
  - For iOS+: `GOOGLE_APP_ID`---Note: **this is not an Apple Bundle ID** .   
    Example value: `1:1234567890:ios:321abc456def7890`

## Troubleshoot Android apps

To improve security, Firebase SDK updates [on February 27](https://firebase.google.com/support/release-notes/android.md.txt#2020-02-27) and
afterwards replaced the Firebase Instance ID service with a dependency on the
[Firebase Installations API](https://console.cloud.google.com/apis/library/firebaseinstallations.googleapis.com).

Firebase installations enforces the existence and validity of mandatory Firebase
options API key, Project ID, and Application ID in order to associate client
data with your Firebase project. See [`FirebaseOptions`](https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseOptions.md.txt) for more
information.

### Firebase Cloud Messaging (FCM) with Firebase Instance ID (IID)

If new users of your app are experiencing issues with FCM, it's
possible that you are initializing Firebase without the required set of Firebase
options.

Your application may be using an incomplete or erroneous
`google-services.json`
configuration file; or your app is
[programmatically initializing Firebase](https://firebase.google.com/docs/projects/multiprojects.md.txt) without the full set of required
Firebase options.

As a result, Firebase services like Firebase Cloud Messaging will malfunction
for end users who installed your app after it was released with the updated
Firebase SDKs. Additionally, repeated failing requests to Firebase may slow down
the end-user experience of your app.

### What do I need to do?

To fix malfunctioning Firebase services for your applications:

1. Update your application by initializing Firebase with a valid API key of your project, a valid Project ID, and a valid Application ID (`mobilesdk_app_id` or "App Id").
   - **Default initialization process using a Firebase config file** : [Download your google-services.json config file](https://support.google.com/firebase/answer/7015592) from the Firebase console, then replace the existing file in your app.
   - **Programmatic initialization using a `FirebaseOptions` object** : [Download your google-services.json config file](https://support.google.com/firebase/answer/7015592) from the Firebase console to find your API key, Project ID, and Application ID, then update these values in the `FirebaseOptions` object in your app.
2. Release a new version of your app to the Play Store.

## Troubleshoot Apple apps

To improve security, Firebase SDK updates [on January 14](https://firebase.google.com/support/release-notes/ios.md.txt#version_6150_-_january_14_2020)
and afterwards replaced the Firebase Instance ID service with a dependency on
the [Firebase Installations API](https://console.cloud.google.com/apis/library/firebaseinstallations.googleapis.com).

Firebase installations enforces the existence and validity of mandatory Firebase
options API key, Project ID, and Application ID in order to associate client
data with your Firebase project. See [`FIROptions`](https://firebase.google.com/support/guides/docs/reference/ios/firebasecore/api/reference/Classes/FIROptions) for more
information.

### Firebase Cloud Messaging (FCM) with Firebase Instance ID (IID)

If new users of your app are experiencing issues with FCM, it's
possible that you are initializing Firebase without the required set of Firebase
options.

Your application may be using an incomplete or invalid
[`GoogleService-Info.plist`](https://firebase.google.com/docs/reference/ios/firebasecore/api/refe%0Arence/Classes/FIRApp) configuration file; or your app is
[programmatically initializing Firebase](https://firebase.google.com/docs/projects/multiprojects.md.txt)
without the full set of required Firebase options.

As a result, Firebase services like Firebase Cloud Messaging will malfunction for
end users who installed your app after it was released with the updated Firebase
SDKs. Additionally, repeated failing requests to Firebase may slow down the end-
user experience of your app.

### What do I need to do?

To fix malfunctioning Firebase services for your applications:

1. Update your application by initializing Firebase with a valid API key of your project, a valid Project ID, and a valid Application ID (`GOOGLE_APP_ID` or "App Id").
   1. **Default initialization process using a Firebase config file** : [Download your GoogleService-Info.plist config file](https://support.google.com/firebase/answer/7015592) from the Firebase console, then replace the existing file in your app.
   2. **Programmatic initialization using a `FIROptions` object** : [Download your GoogleService-Info.plist config file](https://support.google.com/firebase/answer/7015592) from the Firebase console to find your API key, Project ID, and Application ID, then update these values in the `FIROptions` object in your app.
2. Release a new version of your app to the App Store.

## FCM Server keys

If your app is using an [FCM Server key](https://firebase.google.com/docs/cloud-messaging/auth-server#authorize-legacy-protocol-send-requests)
rather than a
Cloud API key, this could cause a security vulnerability in case you are using
the same FCM Server key to send push notifications via FCM.
In this case, we strongly recommend that you revise how your server
[authenticates send requests to FCM](https://firebase.google.com/docs/cloud-messaging/auth-server).

Note that FCM Server Keys (which are not the same as the
Firebase/Cloud API keys) must not be included in applications, as they can be
abused to send push notifications in the name of your project.