Skip to content

Commit c665b6e

Browse files
FIROptions.appGroupID introduced (#3293)
1 parent 4d63873 commit c665b6e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Example/Core/Tests/FIROptionsTest.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ - (void)testCopyingProperties {
197197
options.storageBucket = mutableString;
198198
[mutableString appendString:@"2"];
199199
XCTAssertEqualObjects(options.storageBucket, @"1");
200+
201+
mutableString = [[NSMutableString alloc] initWithString:@"1"];
202+
options.appGroupID = mutableString;
203+
[mutableString appendString:@"2"];
204+
XCTAssertEqualObjects(options.appGroupID, @"1");
200205
}
201206

202207
- (void)testCopyWithZone {

Firebase/Core/FIROptions.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ - (id)copyWithZone:(NSZone *)zone {
179179
if (newOptions) {
180180
newOptions.optionsDictionary = self.optionsDictionary;
181181
newOptions.deepLinkURLScheme = self.deepLinkURLScheme;
182+
newOptions.appGroupID = self.appGroupID;
182183
newOptions.editingLocked = self.isEditingLocked;
183184
newOptions.usingOptionsFromDefaultPlist = self.usingOptionsFromDefaultPlist;
184185
}
@@ -340,6 +341,11 @@ - (void)setBundleID:(NSString *)bundleID {
340341
_optionsDictionary[kFIRBundleID] = [bundleID copy];
341342
}
342343

344+
- (void)setAppGroupID:(NSString *)appGroupID {
345+
[self checkEditingLocked];
346+
_appGroupID = [appGroupID copy];
347+
}
348+
343349
#pragma mark - Internal instance methods
344350

345351
- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary {

Firebase/Core/Public/FIROptions.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ NS_SWIFT_NAME(FirebaseOptions)
9090
*/
9191
@property(nonatomic, copy, nullable) NSString *storageBucket;
9292

93+
/**
94+
* The App Group identifier to share data between the application and the application extensions.
95+
* The App Group must be configured in the application and on the Apple Developer Portal. Default
96+
* value `nil`.
97+
*/
98+
@property(nonatomic, copy, nullable) NSString *appGroupID;
99+
93100
/**
94101
* Initializes a customized instance of FIROptions from the file at the given plist file path. This
95102
* will read the file synchronously from disk.

0 commit comments

Comments
 (0)