Skip to content

Commit 3fffcd8

Browse files
authored
Created REQUIRED_FIREBASE_OPTIONS_IOS.md (#5347)
* Created REQUIRED_FIREBASE_OPTIONS_IOS.md Created public documentation that can be linked to from error messages thrown if client-side lenient format checks of Firebase options fail. b/153238875 https://docs.google.com/document/d/1iuA_LsX650KVlrwS6bN-eVUUQIv_cgKmqMxI7lMGFao/ * Update REQUIRED_FIREBASE_OPTIONS_IOS.md fixed newline
1 parent 43e4733 commit 3fffcd8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Firebase services require valid Firebase options
2+
## Firebase Options
3+
[Firebase options](https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Classes/FIROptions) are a set of parameters required by services in order to successfully communicate with Firebase server APIs and in order to associate client data with your Firebase project and Firebase application.
4+
5+
Firebase services rely on valid Firebase options being available from the Firebase core SDK [`FIRApp`](https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Classes/FIRApp), created during Firebase initialization.
6+
7+
Different Firebase services require different Firebase options to function properly, but all Firebase services require the following Firebase options:
8+
* [**API key**](https://cloud.google.com/docs/authentication/api-keys) - Note: this is **not** an FCM server key, see below. \
9+
Example value: `AIzaSyDOCAbC123dEf456GhI789jKl012-MnO`
10+
* [**Project ID**](https://firebase.google.com/docs/projects/learn-more#project-id) \
11+
Example value: `ios-myapp-123`
12+
* **Application ID**, a.k.a. `GOOGLE_APP_ID`, `mobilesdk_app_id`, "AppId" - Note: this is **not** an Android package name! \
13+
Example value: `1:1234567890:ios:321abc456def7890`
14+
15+
## What do I need to know?
16+
To improve security Firebase SDK updates [on January 14](https://firebase.google.com/support/release-notes/ios#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).
17+
18+
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.
19+
20+
## Firebase Cloud Messaging (FCM) with Firebase Instance ID (IID)
21+
If you are reading this message, most likely your application is initializing Firebase without the required set of Firebase options.
22+
23+
Your application may be using an incomplete or erroneous [`GoogleService-Info.plist`](https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp) configuration file; or your app is [programmatically initializing Firebase](https://firebase.google.com/docs/projects/multiprojects) without the full set of required Firebase options.
24+
25+
As a result, Firebase services like Firebase Cloud Messaging (FCM) 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.
26+
27+
## What do I need to do?
28+
To fix malfunctioning Firebase services for your applications, **please take the following steps as soon as possible:**
29+
1. Update your application by initializing Firebase with a valid API key of your project, a valid Project ID, and a valid Application ID (a.k.a. GOOGLE_APP_ID, mobilesdk_app_id, or simply "App Id").
30+
* **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.
31+
* **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 `FirebaseOptions` object in your app.
32+
1. Release a new version of your app to the App Store.
33+
34+
## FCM Server keys
35+
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. \
36+
In this case, we strongly recommend that you revisit how your server [authenticates send requests to FCM.](https://firebase.google.com/docs/cloud-messaging/auth-server)
37+
38+
Please note that FCM Server Keys (not the same as the Firebase / Cloud API key) must not be included in applications as they can be abused to send push-notifications in the name of your project.
39+
40+
You can [reach out to support](https://firebase.google.com/support/contact?utm_source=email&utm_medium=email&utm_campaign=firebase-installations-api-restrictions-problem) at any time if you have any questions.

0 commit comments

Comments
 (0)