From 10983424f6d8d3487e99bc758d4ab201e542d64c Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:22:41 -0500 Subject: [PATCH] [Config] Move away from private typedef (#14254) --- FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h | 3 --- FirebaseRemoteConfig/Sources/RCNConfigFetch.m | 7 ++++--- FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m | 5 +++-- FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m | 5 +++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h b/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h index 58113944c18..cbe202ec6a8 100644 --- a/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h +++ b/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h @@ -27,9 +27,6 @@ NS_ASSUME_NONNULL_BEGIN -/// Completion handler invoked by NSSessionFetcher. -typedef void (^RCNConfigFetcherCompletion)(NSData *data, NSURLResponse *response, NSError *error); - /// Completion handler invoked after a fetch that contains the updated keys typedef void (^RCNConfigFetchCompletion)(FIRRemoteConfigFetchStatus status, FIRRemoteConfigUpdate *update, diff --git a/FirebaseRemoteConfig/Sources/RCNConfigFetch.m b/FirebaseRemoteConfig/Sources/RCNConfigFetch.m index 3c54afb8c85..89da1c7bb41 100644 --- a/FirebaseRemoteConfig/Sources/RCNConfigFetch.m +++ b/FirebaseRemoteConfig/Sources/RCNConfigFetch.m @@ -423,8 +423,7 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000040", @"Start config fetch."); __weak RCNConfigFetch *weakSelf = self; - RCNConfigFetcherCompletion fetcherCompletion = ^(NSData *data, NSURLResponse *response, - NSError *error) { + __auto_type fetcherCompletion = ^(NSData *data, NSURLResponse *response, NSError *error) { FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000050", @"config fetch completed. Error: %@ StatusCode: %ld", (error ? error : @"nil"), (long)[((NSHTTPURLResponse *)response) statusCode]); @@ -651,7 +650,9 @@ - (NSURLSession *)newFetchSession { - (NSURLSessionDataTask *)URLSessionDataTaskWithContent:(NSData *)content fetchTypeHeader:(NSString *)fetchTypeHeader completionHandler: - (RCNConfigFetcherCompletion)fetcherCompletion { + (void (^)(NSData *data, + NSURLResponse *response, + NSError *error))fetcherCompletion { NSURL *URL = [NSURL URLWithString:[self constructServerURL]]; FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000046", @"%@", [NSString stringWithFormat:@"Making config request: %@", [URL absoluteString]]); diff --git a/FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m b/FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m index 5219da1c5c5..5ecbe418647 100644 --- a/FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m +++ b/FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m @@ -32,8 +32,9 @@ @interface RCNConfigFetch (ForTest) - (NSURLSessionDataTask *)URLSessionDataTaskWithContent:(NSData *)content fetchTypeHeader:(NSString *)fetchTypeHeader - completionHandler: - (RCNConfigFetcherCompletion)fetcherCompletion; + completionHandler:(void (^)(NSData *data, + NSURLResponse *response, + NSError *error))fetcherCompletion; - (void)fetchWithUserProperties:(NSDictionary *)userProperties fetchTypeHeader:(NSString *)fetchTypeHeader diff --git a/FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m b/FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m index e014c8d1da2..21949b58215 100644 --- a/FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m +++ b/FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m @@ -49,8 +49,9 @@ - (void)fetchWithUserPropertiesCompletionHandler:(NSString *)fetchTypeHeader completionHandler:(FIRAInteropUserPropertiesCallback)block; - (NSURLSessionDataTask *)URLSessionDataTaskWithContent:(NSData *)content fetchTypeHeader:(NSString *)fetchTypeHeader - completionHandler: - (RCNConfigFetcherCompletion)fetcherCompletion; + completionHandler:(void (^)(NSData *data, + NSURLResponse *response, + NSError *error))fetcherCompletion; - (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration completionHandler:(FIRRemoteConfigFetchCompletion)completionHandler; - (void)realtimeFetchConfigWithNoExpirationDuration:(NSInteger)fetchAttemptNumber