Skip to content

Commit 4377c7c

Browse files
authored
FirebaseOptions docs: Swift and Analytics exception (#9207)
1 parent 5344857 commit 4377c7c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,30 @@ NS_SWIFT_NAME(FirebaseOptions)
9999
@property(nonatomic, copy, nullable) NSString *appGroupID;
100100

101101
/**
102-
* Initializes a customized instance of FIROptions from the file at the given plist file path. This
103-
* will read the file synchronously from disk.
104-
* For example,
105-
* NSString *filePath =
106-
* [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
107-
* FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
102+
* Initializes a customized instance of FirebaseOptions from the file at the given plist file path.
103+
* This will read the file synchronously from disk.
104+
* For example:
105+
* ```swift
106+
* if let path = Bundle.main.path(forResource:"GoogleServices-Info", ofType:"plist") {
107+
* let options = FirebaseOptions(contentsOfFile: path)
108+
* }
109+
* ```
110+
* Note that it is not possible to customize FirebaseOptions for Firebase Analytics which expects a
111+
* static file named `GoogleServices-Info.plist` -
112+
* https://github.com/firebase/firebase-ios-sdk/issues/230.
108113
* Returns nil if the plist file does not exist or is invalid.
109114
*/
110115
- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER;
111116

112117
/**
113-
* Initializes a customized instance of FIROptions with required fields. Use the mutable properties
114-
* to modify fields for configuring specific services.
118+
* Initializes a customized instance of FirebaseOptions with required fields. Use the mutable
119+
* properties to modify fields for configuring specific services. Note that it is not possible to
120+
* customize FirebaseOptions for Firebase Analytics which expects a static file named
121+
* `GoogleServices-Info.plist` - https://github.com/firebase/firebase-ios-sdk/issues/230.
115122
*/
116-
// clang-format off
117123
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
118124
GCMSenderID:(NSString *)GCMSenderID
119-
NS_SWIFT_NAME(init(googleAppID:gcmSenderID:)) NS_DESIGNATED_INITIALIZER;
120-
// clang-format on
125+
NS_SWIFT_NAME(init(googleAppID:gcmSenderID:))NS_DESIGNATED_INITIALIZER;
121126

122127
/** Unavailable. Please use `init(contentsOfFile:)` or `init(googleAppID:gcmSenderID:)` instead. */
123128
- (instancetype)init NS_UNAVAILABLE;

0 commit comments

Comments
 (0)