1 |
efrain |
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 <Foundation/Foundation.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 : NSObject
|
|
|
42 |
|
|
|
43 |
/// Returns the shared instance of FIRAnalyticsConfiguration.
|
|
|
44 |
+ (FIRAnalyticsConfiguration *)sharedInstance;
|
|
|
45 |
|
|
|
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 |
|
|
|
50 |
/// Sets whether analytics collection is enabled for this app on this device, and a flag to persist
|
|
|
51 |
/// the value or not. The setting should not be persisted if being set by the global data collection
|
|
|
52 |
/// flag.
|
|
|
53 |
- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled
|
|
|
54 |
persistSetting:(BOOL)shouldPersist;
|
|
|
55 |
|
|
|
56 |
@end
|