Skip to content

Commit

Permalink
[Config] Move away from private typedef (#14254)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Dec 13, 2024
1 parent f922738 commit 1098342
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 0 additions & 3 deletions FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions FirebaseRemoteConfig/Sources/RCNConfigFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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]]);
Expand Down
5 changes: 3 additions & 2 deletions FirebaseRemoteConfig/Tests/Unit/RCNPersonalizationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1098342

Please sign in to comment.