|
|
@@ -14,6 +14,7 @@
|
|
|
NSString *const kFLEXNetworkRecorderNewTransactionNotification = @"kFLEXNetworkRecorderNewTransactionNotification";
|
|
|
NSString *const kFLEXNetworkRecorderTransactionUpdatedNotification = @"kFLEXNetworkRecorderTransactionUpdatedNotification";
|
|
|
NSString *const kFLEXNetworkRecorderUserInfoTransactionKey = @"transaction";
|
|
|
+NSString *const kFLEXNetworkRecorderTransactionsClearedNotification = @"kFLEXNetworkRecorderTransactionsClearedNotification";
|
|
|
|
|
|
NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.responseCacheLimit";
|
|
|
|
|
|
@@ -84,6 +85,18 @@ NSString *const kFLEXNetworkRecorderResponseCacheLimitDefaultsKey = @"com.flex.r
|
|
|
return [self.responseCache objectForKey:transaction.requestId];
|
|
|
}
|
|
|
|
|
|
+- (void)clearRecordedActivity
|
|
|
+{
|
|
|
+ dispatch_barrier_async(self.queue, ^{
|
|
|
+ [self.responseCache removeAllObjects];
|
|
|
+ [self.orderedTransactions removeAllObjects];
|
|
|
+ [self.networkTransactionsForRequestIdentifiers removeAllObjects];
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:kFLEXNetworkRecorderTransactionsClearedNotification object:self];
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Network Events
|
|
|
|
|
|
- (void)recordRequestWillBeSentWithRequestId:(NSString *)requestId request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse requestMechanism:(NSString *)mechanism
|