Skip to content

Commit e45e488

Browse files
authored
[Core] Cleanup unused core code (#14914)
1 parent 97df40a commit e45e488

File tree

10 files changed

+29
-50
lines changed

10 files changed

+29
-50
lines changed

FirebaseCore/Sources/FIRAnalyticsConfiguration.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,12 @@ static NSString *const kFIRAPersistedConfigMeasurementEnabledStateKey =
3333

3434
static NSString *const kFIRAnalyticsConfigurationSetEnabledNotification =
3535
@"FIRAnalyticsConfigurationSetEnabledNotification";
36-
static NSString *const kFIRAnalyticsConfigurationSetMinimumSessionIntervalNotification =
37-
@"FIRAnalyticsConfigurationSetMinimumSessionIntervalNotification";
38-
static NSString *const kFIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification =
39-
@"FIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification";
4036

4137
@interface FIRAnalyticsConfiguration : NSObject
4238

4339
/// Returns the shared instance of FIRAnalyticsConfiguration.
4440
+ (FIRAnalyticsConfiguration *)sharedInstance;
4541

46-
// Sets whether analytics collection is enabled for this app on this device. This setting is
47-
// persisted across app sessions. By default it is enabled.
48-
- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled;
49-
5042
/// Sets whether analytics collection is enabled for this app on this device, and a flag to persist
5143
/// the value or not. The setting should not be persisted if being set by the global data collection
5244
/// flag.

FirebaseCore/Sources/FIRAnalyticsConfiguration.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ - (void)postNotificationName:(NSString *)name value:(id)value {
3939
userInfo:@{name : value}];
4040
}
4141

42-
- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled {
43-
[self setAnalyticsCollectionEnabled:analyticsCollectionEnabled persistSetting:YES];
44-
}
45-
4642
- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled
4743
persistSetting:(BOOL)shouldPersist {
4844
// Persist the measurementEnabledState. Use FIRAnalyticsEnabledState values instead of YES/NO.

FirebaseCore/Sources/FIRApp.m

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -448,26 +448,6 @@ + (void)sendNotificationsToSDKs:(FIRApp *)app {
448448
userInfo:appInfoDict];
449449
}
450450

451-
+ (NSError *)errorForMissingOptions {
452-
NSDictionary *errorDict = @{
453-
NSLocalizedDescriptionKey :
454-
@"Unable to parse GoogleService-Info.plist in order to configure services.",
455-
NSLocalizedRecoverySuggestionErrorKey :
456-
@"Check formatting and location of GoogleService-Info.plist."
457-
};
458-
return [NSError errorWithDomain:kFirebaseCoreErrorDomain code:-100 userInfo:errorDict];
459-
}
460-
461-
+ (NSError *)errorForInvalidAppID {
462-
NSDictionary *errorDict = @{
463-
NSLocalizedDescriptionKey : @"Unable to validate Google App ID",
464-
NSLocalizedRecoverySuggestionErrorKey :
465-
@"Check formatting and location of GoogleService-Info.plist or GoogleAppID set in the "
466-
@"customized options."
467-
};
468-
return [NSError errorWithDomain:kFirebaseCoreErrorDomain code:-101 userInfo:errorDict];
469-
}
470-
471451
+ (BOOL)isDefaultAppConfigured {
472452
return (sDefaultApp != nil);
473453
}

FirebaseCore/Sources/FIROptions.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ - (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)i
7676
*/
7777
- (void)checkEditingLocked;
7878

79+
/**
80+
* The flag indicating whether this object was constructed with the values in the default plist
81+
* file.
82+
*/
83+
@property(nonatomic) BOOL usingOptionsFromDefaultPlist;
84+
85+
/**
86+
* Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
87+
* GoogleService-Info.plist.
88+
*/
89+
@property(nonatomic, readonly) BOOL isMeasurementEnabled;
90+
7991
@end
8092

8193
@implementation FIROptions {
@@ -383,8 +395,8 @@ - (NSDictionary *)analyticsOptionsDictionary {
383395

384396
/**
385397
* Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
386-
* GoogleService-Info.plist. This uses the old plist flag IS_MEASUREMENT_ENABLED, which should still
387-
* be supported.
398+
* GoogleService-Info.plist. This uses the old plist flag `IS_MEASUREMENT_ENABLED`, which should
399+
* still be supported.
388400
*/
389401
- (BOOL)isMeasurementEnabled {
390402
if (self.isAnalyticsCollectionDeactivated) {

FirebaseCore/Sources/FIROptionsInternal.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,6 @@
6464
*/
6565
@property(nonatomic, readonly, copy) NSString *libraryVersionID;
6666

67-
/**
68-
* The flag indicating whether this object was constructed with the values in the default plist
69-
* file.
70-
*/
71-
@property(nonatomic) BOOL usingOptionsFromDefaultPlist;
72-
73-
/**
74-
* Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
75-
* GoogleService-Info.plist.
76-
*/
77-
@property(nonatomic, readonly) BOOL isMeasurementEnabled;
78-
7967
/**
8068
* Whether or not editing is locked. This should occur after `FirebaseOptions` has been set on a
8169
* `FirebaseApp`.

FirebaseCore/Tests/Unit/FIRAppTest.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ @interface FIRApp (TestInternal)
4343
+ (void)resetApps;
4444
- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options;
4545
- (BOOL)configureCore;
46-
+ (NSError *)errorForInvalidAppID;
4746
- (BOOL)isAppIDValid;
4847
+ (NSString *)actualBundleID;
4948
+ (NSNumber *)mapFromServiceStringToTypeEnum:(NSString *)serviceString;

FirebaseCore/Tests/Unit/FIROptionsTest.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727

2828
@interface FIROptions (Test)
2929

30+
/**
31+
* The flag indicating whether this object was constructed with the values in the default plist
32+
* file.
33+
*/
34+
@property(nonatomic) BOOL usingOptionsFromDefaultPlist;
35+
36+
/**
37+
* Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
38+
* GoogleService-Info.plist.
39+
*/
40+
@property(nonatomic, readonly) BOOL isMeasurementEnabled;
41+
3042
- (nullable NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:
3143
(nullable NSDictionary *)infoDictionary;
3244

FirebaseFirestoreInternal.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
4545
# that "quick open" by filename in Xcode will continue to work.
4646
s.source_files = [
4747
'FirebaseCore/Extension/*.h',
48-
'FirebaseCore/Sources/FIROptionsInternal.h',
4948
'Firestore/Source/Public/FirebaseFirestore/*.h',
5049
'Firestore/Source/**/*.{m,mm}',
5150
'Firestore/Protos/nanopb/**/*.cc',

Firestore/Source/API/FSTFirestoreComponent.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#import "Firestore/Source/API/FSTFirestoreComponent.h"
1818

1919
#import <FirebaseAppCheckInterop/FirebaseAppCheckInterop.h>
20+
#import <FirebaseCore/FIROptions.h>
2021

2122
#include <memory>
2223
#include <string>
@@ -28,7 +29,6 @@
2829
#import "FirebaseCore/Extension/FIRComponentContainer.h"
2930
#import "FirebaseCore/Extension/FIRComponentType.h"
3031
#import "FirebaseCore/Extension/FIRLibrary.h"
31-
#import "FirebaseCore/Sources/FIROptionsInternal.h"
3232
#import "Firestore/Source/API/FIRFirestore+Internal.h"
3333

3434
#include "Firestore/core/include/firebase/firestore/firestore_version.h"

Firestore/core/src/remote/firebase_metadata_provider_apple.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
#import <FirebaseCore/FIROptions.h>
18+
1719
#include "Firestore/core/src/remote/firebase_metadata_provider_apple.h"
1820

1921
#import "FirebaseCore/Extension/FIRAppInternal.h"
2022
#import "FirebaseCore/Extension/FIRHeartbeatLogger.h"
21-
#import "FirebaseCore/Sources/FIROptionsInternal.h"
2223

2324
#include "Firestore/core/src/util/string_apple.h"
2425

0 commit comments

Comments
 (0)