1 |
efrain |
1 |
// Copyright 2019 Google
|
|
|
2 |
//
|
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
|
5 |
// You may obtain a copy of the License at
|
|
|
6 |
//
|
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
8 |
//
|
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
12 |
// See the License for the specific language governing permissions and
|
|
|
13 |
// limitations under the License.
|
|
|
14 |
|
|
|
15 |
#import <Foundation/Foundation.h>
|
|
|
16 |
|
|
|
17 |
#if __has_include(<FBLPromises/FBLPromises.h>)
|
|
|
18 |
#import <FBLPromises/FBLPromises.h>
|
|
|
19 |
#else
|
|
|
20 |
#import "FBLPromises.h"
|
|
|
21 |
#endif
|
|
|
22 |
|
|
|
23 |
@class FIRCLSApplicationIdentifierModel;
|
|
|
24 |
@class FIRCLSFileManager;
|
|
|
25 |
|
|
|
26 |
NS_ASSUME_NONNULL_BEGIN
|
|
|
27 |
|
|
|
28 |
@interface FIRCLSSettings : NSObject
|
|
|
29 |
|
|
|
30 |
- (instancetype)init NS_UNAVAILABLE;
|
|
|
31 |
+ (instancetype)new NS_UNAVAILABLE;
|
|
|
32 |
- (instancetype)initWithFileManager:(FIRCLSFileManager *)fileManager
|
|
|
33 |
appIDModel:(FIRCLSApplicationIdentifierModel *)appIDModel
|
|
|
34 |
NS_DESIGNATED_INITIALIZER;
|
|
|
35 |
|
|
|
36 |
/**
|
|
|
37 |
* Recreates the settings dictionary by re-reading the settings file from persistent storage. This
|
|
|
38 |
* should be called before any settings values are read, as it will populate the underlying
|
|
|
39 |
* settingsDictionary. If the Google App ID has changed or there is an error, delete the cache file
|
|
|
40 |
* and settingsDictionary. If the cache has expired, set `isCacheExpired` to true so that settings
|
|
|
41 |
* are re-fetched, but do not delete any values.
|
|
|
42 |
*/
|
|
|
43 |
- (void)reloadFromCacheWithGoogleAppID:(NSString *)googleAppID
|
|
|
44 |
currentTimestamp:(NSTimeInterval)currentTimestamp;
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
* Stores a separate file with the settings expiration and Google App ID it was saved with
|
|
|
48 |
* so that we can later determine that the settings have expired.
|
|
|
49 |
*
|
|
|
50 |
* This should be called in a background thread right after the settings.json file has been
|
|
|
51 |
* downloaded.
|
|
|
52 |
*/
|
|
|
53 |
- (void)cacheSettingsWithGoogleAppID:(NSString *)googleAppID
|
|
|
54 |
currentTimestamp:(NSTimeInterval)currentTimestamp;
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
* Returns true when Settings should be fetched from the server again
|
|
|
58 |
*/
|
|
|
59 |
@property(nonatomic, readonly) BOOL isCacheExpired;
|
|
|
60 |
|
|
|
61 |
/**
|
|
|
62 |
* Determines how long these Settings should be respected until the SDK should fetch again
|
|
|
63 |
*/
|
|
|
64 |
@property(nonatomic, readonly) uint32_t cacheDurationSeconds;
|
|
|
65 |
|
|
|
66 |
/**
|
|
|
67 |
* When this is false, Crashlytics will not start up
|
|
|
68 |
*/
|
|
|
69 |
@property(nonatomic, readonly) BOOL collectReportsEnabled;
|
|
|
70 |
|
|
|
71 |
/**
|
|
|
72 |
* When this is false, Crashlytics will not collect non-fatal errors and errors
|
|
|
73 |
* from the custom exception / record error APIs
|
|
|
74 |
*/
|
|
|
75 |
@property(nonatomic, readonly) BOOL errorReportingEnabled;
|
|
|
76 |
|
|
|
77 |
/**
|
|
|
78 |
* When this is false, Crashlytics will not collect custom exceptions from the API
|
|
|
79 |
*/
|
|
|
80 |
@property(nonatomic, readonly) BOOL customExceptionsEnabled;
|
|
|
81 |
|
|
|
82 |
/**
|
|
|
83 |
* When this is true, Crashlytics will collect data from MetricKit
|
|
|
84 |
*/
|
|
|
85 |
@property(nonatomic, readonly) BOOL metricKitCollectionEnabled;
|
|
|
86 |
|
|
|
87 |
/**
|
|
|
88 |
* Returns the maximum number of custom exception events that will be
|
|
|
89 |
* recorded in a session.
|
|
|
90 |
*/
|
|
|
91 |
@property(nonatomic, readonly) uint32_t errorLogBufferSize;
|
|
|
92 |
|
|
|
93 |
/**
|
|
|
94 |
* Returns the maximum size of the log buffer in bytes
|
|
|
95 |
*/
|
|
|
96 |
@property(nonatomic, readonly) uint32_t logBufferSize;
|
|
|
97 |
|
|
|
98 |
/**
|
|
|
99 |
* Returns the maximum number of custom exceptions that will be collected
|
|
|
100 |
* in a session.
|
|
|
101 |
*/
|
|
|
102 |
@property(nonatomic, readonly) uint32_t maxCustomExceptions;
|
|
|
103 |
|
|
|
104 |
/**
|
|
|
105 |
* Returns the maximum number of custom key-value pair keys (not bytes).
|
|
|
106 |
*/
|
|
|
107 |
@property(nonatomic, readonly) uint32_t maxCustomKeys;
|
|
|
108 |
|
|
|
109 |
/**
|
|
|
110 |
* Returns the initial upload rate for on-demand exception reporting.
|
|
|
111 |
*/
|
|
|
112 |
@property(nonatomic, readonly) double onDemandUploadRate;
|
|
|
113 |
|
|
|
114 |
/**
|
|
|
115 |
* Base exponent used when exponential backoff is triggered for on-demand reporting.
|
|
|
116 |
*/
|
|
|
117 |
@property(nonatomic, readonly) double onDemandBackoffBase;
|
|
|
118 |
|
|
|
119 |
/**
|
|
|
120 |
* Step duration to use with exponential backoff for on-demand reporting.
|
|
|
121 |
*/
|
|
|
122 |
@property(nonatomic, readonly) uint32_t onDemandBackoffStepDuration;
|
|
|
123 |
|
|
|
124 |
@end
|
|
|
125 |
|
|
|
126 |
NS_ASSUME_NONNULL_END
|