14
14
15
15
#import < UIKit/UIKit.h>
16
16
17
+ #import < GoogleUtilities/GULUserDefaults.h>
18
+
17
19
#import " FirebasePerformance/Sources/Common/FPRConstants.h"
18
20
#import " FirebasePerformance/Sources/Configurations/FPRConfigurations+Private.h"
19
21
#import " FirebasePerformance/Sources/Configurations/FPRConfigurations.h"
@@ -58,9 +60,9 @@ + (instancetype)sharedInstance {
58
60
+ (void )reset {
59
61
// TODO(b/120032990): Reset the singletons that this singleton uses.
60
62
gSharedInstanceToken = 0 ;
61
- [[NSUserDefaults standardUserDefaults ]
63
+ [[GULUserDefaults standardUserDefaults ]
62
64
removeObjectForKey: kFPRConfigInstrumentationUserPreference ];
63
- [[NSUserDefaults standardUserDefaults ] removeObjectForKey: kFPRConfigCollectionUserPreference ];
65
+ [[GULUserDefaults standardUserDefaults ] removeObjectForKey: kFPRConfigCollectionUserPreference ];
64
66
}
65
67
66
68
- (instancetype )initWithSources : (FPRConfigurationSource)source {
@@ -73,7 +75,7 @@ - (instancetype)initWithSources:(FPRConfigurationSource)source {
73
75
[self registerForNotifications ];
74
76
75
77
self.FIRAppClass = [FIRApp class ];
76
- self.userDefaults = [NSUserDefaults standardUserDefaults ];
78
+ self.userDefaults = [GULUserDefaults standardUserDefaults ];
77
79
self.infoDictionary = [NSBundle mainBundle ].infoDictionary ;
78
80
self.mainBundleIdentifier = [NSBundle mainBundle ].bundleIdentifier ;
79
81
self.updateQueue = dispatch_queue_create (" com.google.perf.configUpdate" , DISPATCH_QUEUE_SERIAL);
@@ -141,7 +143,7 @@ - (void)setDataCollectionEnabled:(BOOL)dataCollectionEnabled {
141
143
142
144
// The data collection flag is determined by this order:
143
145
// 1. A plist flag for permanently disabling data collection
144
- // 2. The runtime flag (NSUserDefaults )
146
+ // 2. The runtime flag (GULUserDefaults )
145
147
// 3. A plist flag for enabling/disabling (overrideable)
146
148
// 4. The global data collection switch from Core.
147
149
- (BOOL )isDataCollectionEnabled {
@@ -165,7 +167,7 @@ - (BOOL)isDataCollectionEnabled {
165
167
}
166
168
}
167
169
/* *
168
- * Check if the performance collection preference key is available in NSUserDefaults .
170
+ * Check if the performance collection preference key is available in GULUserDefaults .
169
171
* If it exists - Just honor that and return that value.
170
172
* If it does not exist - Check if firebase_performance_collection_enabled exists in Info.plist.
171
173
* If it exists - honor that and return that value.
@@ -196,7 +198,7 @@ - (BOOL)isInstrumentationEnabled {
196
198
[self .userDefaults objectForKey: kFPRConfigInstrumentationUserPreference ];
197
199
198
200
/* *
199
- * Check if the performance instrumentation preference key is available in NSUserDefaults .
201
+ * Check if the performance instrumentation preference key is available in GULUserDefaults .
200
202
* If it exists - Just honor that and return that value.
201
203
* If not - Check if firebase_performance_instrumentation_enabled exists in Info.plist.
202
204
* If it exists - honor that and return that value.
@@ -242,7 +244,7 @@ - (BOOL)diagnosticsEnabled {
242
244
BOOL enabled = NO ;
243
245
244
246
/* *
245
- * Check if the diagnostics preference key is available in NSUserDefaults .
247
+ * Check if the diagnostics preference key is available in GULUserDefaults .
246
248
* If it exists - Just honor that and return that value.
247
249
* If not - Check if firebase_performance_instrumentation_enabled exists in Info.plist.
248
250
* If it exists - honor that and return that value.
@@ -282,8 +284,8 @@ - (int)logSource {
282
284
* Order of preference of returning the log source.
283
285
* If it is an autopush build (based on environment variable), always return
284
286
* LogRequest_LogSource_FireperfAutopush (461). If there is a recent value of remote config fetch,
285
- * honor that value. If logSource cached value (NSUserDefaults value) exists, honor that. Fallback
286
- * to the default value LogRequest_LogSource_Fireperf (462).
287
+ * honor that value. If logSource cached value (GULUserDefaults value) exists, honor that.
288
+ * Fallback to the default value LogRequest_LogSource_Fireperf (462).
287
289
*/
288
290
int logSource = 462 ;
289
291
0 commit comments