Skip to content

Commit 7196035

Browse files
authored
Firebase Options Documentation (#10510)
1 parent c9da4eb commit 7196035

File tree

2 files changed

+82
-6
lines changed

2 files changed

+82
-6
lines changed

FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ NS_SWIFT_NAME(FirebaseOptions)
3131
+ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions());
3232

3333
/**
34-
* An iOS API key used for authenticating requests from your app, e.g.
34+
* An API key used for authenticating requests from your Apple app, e.g.
3535
* The key must begin with "A" and contain exactly 39 alphanumeric characters, used to identify your
3636
* app to Google servers.
3737
*/
@@ -44,19 +44,19 @@ NS_SWIFT_NAME(FirebaseOptions)
4444
@property(nonatomic, copy) NSString *bundleID;
4545

4646
/**
47-
* The OAuth2 client ID for iOS application used to authenticate Google users, for example
47+
* The OAuth2 client ID for Apple applications used to authenticate Google users, for example
4848
* @"12345.apps.googleusercontent.com", used for signing in with Google.
4949
*/
5050
@property(nonatomic, copy, nullable) NSString *clientID;
5151

5252
/**
53-
* The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics.
53+
* Unused.
5454
*/
5555
@property(nonatomic, copy, nullable) NSString *trackingID;
5656

5757
/**
5858
* The Project Number from the Google Developer's console, for example @"012345678901", used to
59-
* configure Google Cloud Messaging.
59+
* configure Firebase Cloud Messaging.
6060
*/
6161
@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID);
6262

@@ -66,8 +66,7 @@ NS_SWIFT_NAME(FirebaseOptions)
6666
@property(nonatomic, copy, nullable) NSString *projectID;
6767

6868
/**
69-
* The Android client ID used in Google AppInvite when an iOS app has its Android version, for
70-
* example @"12345.apps.googleusercontent.com".
69+
* Unused.
7170
*/
7271
@property(nonatomic, copy, nullable) NSString *androidClientID;
7372

docs/FirebaseOptionsPerProduct.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Firebase Options Usage By Product
2+
3+
Summarize which Firebase Options fields (and GoogleService-Info.plist attributes) are used by which Firebase products.
4+
5+
| | An | ApC | ApD | Aut | Cor | Crs | DB | DL | Fst | Fn | IAM | Ins | Msg | MLM | Prf | RC | Str |
6+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
7+
| **apiKey** | |||| | | || | ||| | ||| |
8+
| **bundleID** | | | | || | | | | | | | | || | |
9+
| **clientID** | | | || | | | | | | | | | | | | |
10+
| **gcmSenderID** | | | | | | | | | | |||| | || |
11+
| **projectID** | || | | | || ||| || |||| |
12+
| **googleAppID** ||| || ||| | | |||| ||||
13+
| **databaseURL** | | | | | | || | | | | | | | | | |
14+
| **deepLinkURLScheme** | | | | | | | || | | | | | | | | |
15+
| **storageBucket** | | | | | | | | | | | | | | | | ||
16+
17+
18+
## Rows (FirebaseOptions)
19+
See [FIROptions.m](https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCore/Sources/FIROptions.m) to see how the variables map
20+
to GoogleService-Info.plist attributes.
21+
22+
* *apiKey*: An API key used for authenticating requests from your Apple app
23+
* *bundleID*: The bundle ID for the application (Not used by the SDK)
24+
* *clientID*: The OAuth2 client ID for Apple applications used to authenticate Google users
25+
* *gcmSenderID*: The Project Number from the Google Developer's console used to configure Google Cloud Messaging
26+
* *projectID*: The Project ID from the Firebase console
27+
* *googleAppID*: The Google App ID that is used to uniquely identify an instance of an app
28+
* *databaseURL*: The realtime database root URL
29+
* *deepLinkURLScheme*: The URL scheme used to set up Durable Deep Link service
30+
* *storageBucket*: The Google Cloud Storage bucket name
31+
32+
## Questions
33+
34+
* *apiKey*, *projectID*, *gcmSenderID*, *projectID*, and *googleAppID* seem to have overlapping
35+
functionality. Can they be consolidated?
36+
* *gcmSenderID* is the second subfield of *googleAppID*. Can it be eliminated?
37+
* *bundleID* seems to have three purposes: Performance SDK uses it. Messaging back end uses it. Core
38+
will generate an error message if it doesn't match the actual bundleID. Anything else?
39+
* Why isn't *deepLinkURLScheme* set from the GoogleService-Info.plist field `REVERSED_CLIENT_ID` like
40+
other Firebase Options? The client code is required to explicitly set it.
41+
* Is there a better way to manage the fields that are only used by one product? *clientID*, *databaseURL*,
42+
*deepLinkURLScheme*, and *storageBucket*.
43+
44+
## Unused FirebaseOptions
45+
Proposal: Deprecate these in the SDK and stop generating them for GoogleService-Info.plist.
46+
47+
* *androidClientID*
48+
* *trackingID*
49+
50+
## Unread GoogleService-Info.plist fields
51+
Proposal: Stop generating these for GoogleService-Info.plist.
52+
53+
* PLIST_VERSION
54+
* IS_ADS_ENABLED
55+
* IS_ANALYTICS_ENABLED
56+
* IS_APPINVITE_ENABLED
57+
* IS_GCM_ENABLED
58+
* IS_SIGNIN_ENABLED
59+
60+
## Columns (Firebase Products)
61+
* An - Analytics
62+
* ApC - App Check
63+
* ApD - App Distribution
64+
* Aut - Auth
65+
* Cor - Core
66+
* Crs - Crashlytics
67+
* DB - Real-time Database
68+
* DL - Dynamic Links
69+
* Fst - Firestore
70+
* Fn - Functions
71+
* IAM - In App Messaging
72+
* Ins - Installations
73+
* Msg - Messaging
74+
* MLM - MLModel Downloader
75+
* Prf - Performance
76+
* RC - Remote Config
77+
* Str - Storage

0 commit comments

Comments
 (0)