@@ -97,6 +97,19 @@ typedef NS_ERROR_ENUM(FIRRemoteConfigUpdateErrorDomain, FIRRemoteConfigUpdateErr
9797 FIRRemoteConfigUpdateErrorUnavailable = 8004 ,
9898} NS_SWIFT_NAME(RemoteConfigUpdateError);
9999
100+ // / Error domain for custom signals errors.
101+ extern NSString *const _Nonnull FIRRemoteConfigCustomSignalsErrorDomain NS_SWIFT_NAME (RemoteConfigCustomSignalsErrorDomain);
102+
103+ // / Firebase Remote Config custom signals error.
104+ typedef NS_ERROR_ENUM (FIRRemoteConfigCustomSignalsErrorDomain, FIRRemoteConfigCustomSignalsError){
105+ // / Unknown error.
106+ FIRRemoteConfigCustomSignalsErrorUnknown = 8101 ,
107+ // / Invalid value type in the custom signals dictionary.
108+ FIRRemoteConfigCustomSignalsErrorInvalidValueType = 8102 ,
109+ // / Limit exceeded for key length, value length, or number of signals.
110+ FIRRemoteConfigCustomSignalsErrorLimitExceeded = 8103 ,
111+ } NS_SWIFT_NAME(RemoteConfigCustomSignalsError);
112+
100113// / Enumerated value that indicates the source of Remote Config data. Data can come from
101114// / the Remote Config service, the DefaultConfig that is available when the app is first installed,
102115// / or a static initialized value if data is not available from the service or DefaultConfig.
@@ -223,6 +236,22 @@ NS_SWIFT_NAME(RemoteConfig)
223236- (void )ensureInitializedWithCompletionHandler:
224237 (void (^_Nonnull)(NSError *_Nullable initializationError))completionHandler;
225238#pragma mark - Fetch
239+
240+ #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
241+ // / Fetches Remote Config data with a callback. Call `activate()` to make fetched data
242+ // / available to your app.
243+ // /
244+ // / Note: This method uses a Firebase Installations token to identify the app instance, and once
245+ // / it's called, it periodically sends data to the Firebase backend. (see
246+ // / `Installations.authToken(completion:)`).
247+ // / To stop the periodic sync, call `Installations.delete(completion:)`
248+ // / and avoid calling this method again.
249+ // /
250+ // / @param completionHandler Fetch operation callback with status and error parameters.
251+ - (void )fetchWithCompletionHandler:
252+ (void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchStatus status,
253+ NSError *_Nullable error))completionHandler;
254+ #else
226255// / Fetches Remote Config data with a callback. Call `activate()` to make fetched data
227256// / available to your app.
228257// /
@@ -235,7 +264,27 @@ NS_SWIFT_NAME(RemoteConfig)
235264// / @param completionHandler Fetch operation callback with status and error parameters.
236265- (void )fetchWithCompletionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
237266 NSError *_Nullable error))completionHandler;
267+ #endif
238268
269+ #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
270+ // / Fetches Remote Config data and sets a duration that specifies how long config data lasts.
271+ // / Call `activateWithCompletion:` to make fetched data available to your app.
272+ // /
273+ // / Note: This method uses a Firebase Installations token to identify the app instance, and once
274+ // / it's called, it periodically sends data to the Firebase backend. (see
275+ // / `Installations.authToken(completion:)`).
276+ // / To stop the periodic sync, call `Installations.delete(completion:)`
277+ // / and avoid calling this method again.
278+ // /
279+ // / @param expirationDuration Override the (default or optionally set `minimumFetchInterval`
280+ // / property in RemoteConfigSettings) `minimumFetchInterval` for only the current request, in
281+ // / seconds. Setting a value of 0 seconds will force a fetch to the backend.
282+ // / @param completionHandler Fetch operation callback with status and error parameters.
283+ - (void )fetchWithExpirationDuration:(NSTimeInterval )expirationDuration
284+ completionHandler:(void (^_Nullable NS_SWIFT_SENDABLE)(
285+ FIRRemoteConfigFetchStatus status,
286+ NSError *_Nullable error))completionHandler;
287+ #else
239288// / Fetches Remote Config data and sets a duration that specifies how long config data lasts.
240289// / Call `activateWithCompletion:` to make fetched data available to your app.
241290// /
@@ -252,7 +301,23 @@ NS_SWIFT_NAME(RemoteConfig)
252301- (void )fetchWithExpirationDuration:(NSTimeInterval )expirationDuration
253302 completionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
254303 NSError *_Nullable error))completionHandler;
304+ #endif
255305
306+ #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
307+ // / Fetches Remote Config data and if successful, activates fetched data. Optional completion
308+ // / handler callback is invoked after the attempted activation of data, if the fetch call succeeded.
309+ // /
310+ // / Note: This method uses a Firebase Installations token to identify the app instance, and once
311+ // / it's called, it periodically sends data to the Firebase backend. (see
312+ // / `Installations.authToken(completion:)`).
313+ // / To stop the periodic sync, call `Installations.delete(completion:)`
314+ // / and avoid calling this method again.
315+ // /
316+ // / @param completionHandler Fetch operation callback with status and error parameters.
317+ - (void )fetchAndActivateWithCompletionHandler:
318+ (void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchAndActivateStatus status,
319+ NSError *_Nullable error))completionHandler;
320+ #else
256321// / Fetches Remote Config data and if successful, activates fetched data. Optional completion
257322// / handler callback is invoked after the attempted activation of data, if the fetch call succeeded.
258323// /
@@ -266,14 +331,23 @@ NS_SWIFT_NAME(RemoteConfig)
266331- (void )fetchAndActivateWithCompletionHandler:
267332 (void (^_Nullable)(FIRRemoteConfigFetchAndActivateStatus status,
268333 NSError *_Nullable error))completionHandler;
334+ #endif
269335
270336#pragma mark - Apply
271337
338+ #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
339+ // / Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance
340+ // / of the app to take effect (depending on how config data is used in the app).
341+ // / @param completion Activate operation callback with changed and error parameters.
342+ - (void )activateWithCompletion:
343+ (void (^_Nullable NS_SWIFT_SENDABLE)(BOOL changed, NSError *_Nullable error))completion;
344+ #else
272345// / Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance
273346// / of the app to take effect (depending on how config data is used in the app).
274347// / @param completion Activate operation callback with changed and error parameters.
275348- (void )activateWithCompletion:(void (^_Nullable)(BOOL changed,
276349 NSError *_Nullable error))completion;
350+ #endif
277351
278352#pragma mark - Get Config
279353// / Enables access to configuration values by using object subscripting syntax.
@@ -358,4 +432,8 @@ typedef void (^FIRRemoteConfigUpdateCompletion)(FIRRemoteConfigUpdate *_Nullable
358432 (FIRRemoteConfigUpdateCompletion _Nonnull)listener
359433 NS_SWIFT_NAME (addOnConfigUpdateListener(remoteConfigUpdateCompletion:));
360434
435+ - (void )setCustomSignals:(nonnull NSDictionary <NSString *, NSObject *> *)customSignals
436+ withCompletion:(void (^_Nullable)(NSError *_Nullable error))completionHandler
437+ NS_REFINED_FOR_SWIFT;
438+
361439@end
0 commit comments