diff options
Diffstat (limited to 'Firebase')
-rw-r--r-- | Firebase/Core/FIROptions.m | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Firebase/Core/FIROptions.m b/Firebase/Core/FIROptions.m index aecb95d..fc92a55 100644 --- a/Firebase/Core/FIROptions.m +++ b/Firebase/Core/FIROptions.m @@ -62,12 +62,19 @@ NSString *const kFIRExceptionBadModification = @property(nonatomic, readwrite) NSMutableDictionary *optionsDictionary; /** - * Combination of analytics options from both the main plist and the GoogleService-Info.plist. + * Calls `analyticsOptionsDictionaryWithInfoDictionary:` using [NSBundle mainBundle].infoDictionary. + * It combines analytics options from both the infoDictionary and the GoogleService-Info.plist. * Values which are present in the main plist override values from the GoogleService-Info.plist. */ @property(nonatomic, readonly) NSDictionary *analyticsOptionsDictionary; /** + * Combination of analytics options from both the infoDictionary and the GoogleService-Info.plist. + * Values which are present in the infoDictionary override values from the GoogleService-Info.plist. + */ +- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary; + +/** * Throw exception if editing is locked when attempting to modify an option. */ - (void)checkEditingLocked; @@ -346,16 +353,15 @@ static NSDictionary *sDefaultOptionsDictionary = nil; #pragma mark - Internal instance methods -- (NSDictionary *)analyticsOptionsDictionary { +- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary { dispatch_once(&_createAnalyticsOptionsDictionaryOnce, ^{ NSMutableDictionary *tempAnalyticsOptions = [[NSMutableDictionary alloc] init]; - NSDictionary *mainInfoDictionary = [NSBundle mainBundle].infoDictionary; NSArray *measurementKeys = @[ kFIRIsMeasurementEnabled, kFIRIsAnalyticsCollectionEnabled, kFIRIsAnalyticsCollectionDeactivated ]; for (NSString *key in measurementKeys) { - id value = mainInfoDictionary[key] ?: self.optionsDictionary[key] ?: nil; + id value = infoDictionary[key] ?: self.optionsDictionary[key] ?: nil; if (!value) { continue; } @@ -366,6 +372,10 @@ static NSDictionary *sDefaultOptionsDictionary = nil; return _analyticsOptionsDictionary; } +- (NSDictionary *)analyticsOptionsDictionary { + return [self analyticsOptionsDictionaryWithInfoDictionary:[NSBundle mainBundle].infoDictionary]; +} + /** * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in * GoogleService-Info.plist. This uses the old plist flag IS_MEASUREMENT_ENABLED, which should still |