Files
firebase-ios-sdk/FirebaseRemoteConfig/Sources/RCNConfigFetch.h
T

64 lines
2.5 KiB
Objective-C
Raw Normal View History

2019-08-21 14:26:41 -07:00
/*
* Copyright 2019 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import <FirebaseAnalyticsInterop/FIRAnalyticsInterop.h>
#import <FirebaseRemoteConfig/FIRRemoteConfig.h>
@class FIROptions;
@class RCNConfigContent;
@class RCNConfigSettings;
@class RCNConfigExperiment;
@class RCNConfigDBManager;
NS_ASSUME_NONNULL_BEGIN
/// Completion handler invoked by NSSessionFetcher.
typedef void (^RCNConfigFetcherCompletion)(NSData *data, NSURLResponse *response, NSError *error);
/// Test block used for global NSSessionFetcher.
typedef void (^RCNConfigFetcherTestBlock)(RCNConfigFetcherCompletion completion);
@interface RCNConfigFetch : NSObject
- (instancetype)init NS_UNAVAILABLE;
/// Designated initializer
- (instancetype)initWithContent:(RCNConfigContent *)content
DBManager:(RCNConfigDBManager *)DBManager
settings:(RCNConfigSettings *)settings
analytics:(nullable id<FIRAnalyticsInterop>)analytics
experiment:(nullable RCNConfigExperiment *)experiment
queue:(dispatch_queue_t)queue
namespace:(NSString *)firebaseNamespace
options:(FIROptions *)firebaseOptions NS_DESIGNATED_INITIALIZER;
2019-12-04 07:44:31 -08:00
/// Fetches config data keyed by namespace. Completion block will be called on the main queue.
2019-08-21 14:26:41 -07:00
/// @param expirationDuration Expiration duration, in seconds.
/// @param completionHandler Callback handler.
2019-12-04 07:44:31 -08:00
- (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration
completionHandler:(FIRRemoteConfigFetchCompletion)completionHandler;
2019-08-21 14:26:41 -07:00
/// Add the ability to update NSURLSession's timeout after a session has already been created.
- (void)recreateNetworkSession;
2019-08-21 14:26:41 -07:00
/// Sets the test block to mock the fetch response instead of performing the fetch task from server.
+ (void)setGlobalTestBlock:(RCNConfigFetcherTestBlock)block;
NS_ASSUME_NONNULL_END
@end