@@ -56,7 +56,7 @@ - (instancetype)initWithManagerData:(FIRCLSManagerData *)managerData
56
56
* last run of the app, this promise is immediately resolved so that the upload of any nonfatal
57
57
* events can proceed.
58
58
*/
59
- - (void )registerMetricKitManager {
59
+ - (void )registerMetricKitManager API_AVAILABLE(ios( 14 )) {
60
60
[[MXMetricManager sharedManager ] addSubscriber: self ];
61
61
self.metricKitDataAvailable = [FBLPromise pendingPromise ];
62
62
@@ -95,7 +95,8 @@ - (void)registerMetricKitManager {
95
95
* immediately after the event. Since we send nonfatal events on the next run of the app, we can
96
96
* write out the information but won't need to resolve the promise.
97
97
*/
98
- - (void )didReceiveDiagnosticPayloads : (NSArray <MXDiagnosticPayload *> *)payloads {
98
+ - (void )didReceiveDiagnosticPayloads : (NSArray <MXDiagnosticPayload *> *)payloads
99
+ API_AVAILABLE(ios(14 )) {
99
100
BOOL processedFatalPayload = NO ;
100
101
for (MXDiagnosticPayload *diagnosticPayload in payloads) {
101
102
if (!diagnosticPayload) {
@@ -118,7 +119,7 @@ - (void)didReceiveDiagnosticPayloads:(NSArray<MXDiagnosticPayload *> *)payloads
118
119
119
120
// Helper method to write a MetricKit payload's data to file.
120
121
- (BOOL )processMetricKitPayload : (MXDiagnosticPayload *)diagnosticPayload
121
- skipCrashEvent : (BOOL )skipCrashEvent {
122
+ skipCrashEvent : (BOOL )skipCrashEvent API_AVAILABLE(ios( 14 )) {
122
123
BOOL writeFailed = NO ;
123
124
124
125
// Write out each type of diagnostic if it exists in the report
@@ -144,7 +145,6 @@ - (BOOL)processMetricKitPayload:(MXDiagnosticPayload *)diagnosticPayload
144
145
// Also ensure that there is a report from the last run of the app that we can write to.
145
146
NSString *metricKitFatalReportFile;
146
147
NSString *metricKitNonfatalReportFile;
147
- NSString *metricKitReportFile;
148
148
NSString *newestUnsentReportID =
149
149
[self .existingReportManager.newestUnsentReport.reportID stringByAppendingString: @" /" ];
150
150
NSString *currentReportID =
@@ -316,7 +316,7 @@ - (BOOL)processMetricKitPayload:(MXDiagnosticPayload *)diagnosticPayload
316
316
* Required for MXMetricManager subscribers. Since we aren't currently collecting any MetricKit
317
317
* metrics, this method is left empty.
318
318
*/
319
- - (void )didReceiveMetricPayloads : (NSArray <MXMetricPayload *> *)payloads {
319
+ - (void )didReceiveMetricPayloads : (NSArray <MXMetricPayload *> *)payloads API_AVAILABLE(ios( 13 )) {
320
320
}
321
321
322
322
- (FBLPromise *)waitForMetricKitDataAvailable {
@@ -330,15 +330,16 @@ - (FBLPromise *)waitForMetricKitDataAvailable {
330
330
/*
331
331
* Helper method to convert threads for a MetricKit fatal diagnostic event to an array of threads.
332
332
*/
333
- - (NSArray *)convertThreadsToArray : (MXCallStackTree *)mxCallStackTree {
333
+ - (NSArray *)convertThreadsToArray : (MXCallStackTree *)mxCallStackTree API_AVAILABLE(ios( 14 )) {
334
334
FIRCLSCallStackTree *tree = [[FIRCLSCallStackTree alloc ] initWithMXCallStackTree: mxCallStackTree];
335
335
return [tree getArrayRepresentation ];
336
336
}
337
337
338
338
/*
339
339
* Helper method to convert threads for a MetricKit nonfatal diagnostic event to an array of frames.
340
340
*/
341
- - (NSArray *)convertThreadsToArrayForNonfatal : (MXCallStackTree *)mxCallStackTree {
341
+ - (NSArray *)convertThreadsToArrayForNonfatal : (MXCallStackTree *)mxCallStackTree
342
+ API_AVAILABLE(ios(14 )) {
342
343
FIRCLSCallStackTree *tree = [[FIRCLSCallStackTree alloc ] initWithMXCallStackTree: mxCallStackTree];
343
344
return [tree getFramesOfBlamedThread ];
344
345
}
@@ -347,7 +348,7 @@ - (NSArray *)convertThreadsToArrayForNonfatal:(MXCallStackTree *)mxCallStackTree
347
348
* Helper method to convert metadata for a MetricKit diagnostic event to a dictionary. MXMetadata
348
349
* has a dictionaryRepresentation method but it is deprecated.
349
350
*/
350
- - (NSDictionary *)convertMetadataToDictionary : (MXMetaData *)metadata {
351
+ - (NSDictionary *)convertMetadataToDictionary : (MXMetaData *)metadata API_AVAILABLE(ios( 14 )) {
351
352
NSError *error = nil ;
352
353
NSDictionary *metadataDictionary =
353
354
[NSJSONSerialization JSONObjectWithData: [metadata JSONRepresentation ] options: 0 error: &error];
0 commit comments