added iOS source code
[wl-app.git] / iOS / Pods / FirebaseCore / Firebase / Core / Private / FIRAnalyticsConfiguration+Internal.h
1 /*
2  * Copyright 2017 Google
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #import "FIRAnalyticsConfiguration.h"
18
19 /// Values stored in analyticsEnabledState. Never alter these constants since they must match with
20 /// values persisted to disk.
21 typedef NS_ENUM(int64_t, FIRAnalyticsEnabledState) {
22   // 0 is the default value for keys not found stored in persisted config, so it cannot represent
23   // kFIRAnalyticsEnabledStateSetNo. It must represent kFIRAnalyticsEnabledStateNotSet.
24   kFIRAnalyticsEnabledStateNotSet = 0,
25   kFIRAnalyticsEnabledStateSetYes = 1,
26   kFIRAnalyticsEnabledStateSetNo = 2,
27 };
28
29 /// The user defaults key for the persisted measurementEnabledState value. FIRAPersistedConfig reads
30 /// measurementEnabledState using this same key.
31 static NSString *const kFIRAPersistedConfigMeasurementEnabledStateKey =
32     @"/google/measurement/measurement_enabled_state";
33
34 static NSString *const kFIRAnalyticsConfigurationSetEnabledNotification =
35     @"FIRAnalyticsConfigurationSetEnabledNotification";
36 static NSString *const kFIRAnalyticsConfigurationSetMinimumSessionIntervalNotification =
37     @"FIRAnalyticsConfigurationSetMinimumSessionIntervalNotification";
38 static NSString *const kFIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification =
39     @"FIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification";
40
41 @interface FIRAnalyticsConfiguration (Internal)
42
43 /// Sets whether analytics collection is enabled for this app on this device, and a flag to persist
44 /// the value or not. The setting should not be persisted if being set by the global data collection
45 /// flag.
46 - (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled
47                        persistSetting:(BOOL)shouldPersist;
48
49 @end