Skip to content

Commit 7508c62

Browse files
committed
[Config] Conditionally mark closures as Sendable for Xcode 16
1 parent c092c02 commit 7508c62

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ NS_SWIFT_NAME(RemoteConfig)
223223
- (void)ensureInitializedWithCompletionHandler:
224224
(void (^_Nonnull)(NSError *_Nullable initializationError))completionHandler;
225225
#pragma mark - Fetch
226+
227+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
228+
/// Fetches Remote Config data with a callback. Call `activate()` to make fetched data
229+
/// available to your app.
230+
///
231+
/// Note: This method uses a Firebase Installations token to identify the app instance, and once
232+
/// it's called, it periodically sends data to the Firebase backend. (see
233+
/// `Installations.authToken(completion:)`).
234+
/// To stop the periodic sync, call `Installations.delete(completion:)`
235+
/// and avoid calling this method again.
236+
///
237+
/// @param completionHandler Fetch operation callback with status and error parameters.
238+
- (void)fetchWithCompletionHandler:
239+
(void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchStatus status,
240+
NSError *_Nullable error))completionHandler;
241+
#else
226242
/// Fetches Remote Config data with a callback. Call `activate()` to make fetched data
227243
/// available to your app.
228244
///
@@ -235,7 +251,27 @@ NS_SWIFT_NAME(RemoteConfig)
235251
/// @param completionHandler Fetch operation callback with status and error parameters.
236252
- (void)fetchWithCompletionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
237253
NSError *_Nullable error))completionHandler;
254+
#endif
238255

256+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
257+
/// Fetches Remote Config data and sets a duration that specifies how long config data lasts.
258+
/// Call `activateWithCompletion:` to make fetched data available to your app.
259+
///
260+
/// Note: This method uses a Firebase Installations token to identify the app instance, and once
261+
/// it's called, it periodically sends data to the Firebase backend. (see
262+
/// `Installations.authToken(completion:)`).
263+
/// To stop the periodic sync, call `Installations.delete(completion:)`
264+
/// and avoid calling this method again.
265+
///
266+
/// @param expirationDuration Override the (default or optionally set `minimumFetchInterval`
267+
/// property in RemoteConfigSettings) `minimumFetchInterval` for only the current request, in
268+
/// seconds. Setting a value of 0 seconds will force a fetch to the backend.
269+
/// @param completionHandler Fetch operation callback with status and error parameters.
270+
- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration
271+
completionHandler:(void (^_Nullable NS_SWIFT_SENDABLE)(
272+
FIRRemoteConfigFetchStatus status,
273+
NSError *_Nullable error))completionHandler;
274+
#else
239275
/// Fetches Remote Config data and sets a duration that specifies how long config data lasts.
240276
/// Call `activateWithCompletion:` to make fetched data available to your app.
241277
///
@@ -252,7 +288,23 @@ NS_SWIFT_NAME(RemoteConfig)
252288
- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration
253289
completionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
254290
NSError *_Nullable error))completionHandler;
291+
#endif
255292

293+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
294+
/// Fetches Remote Config data and if successful, activates fetched data. Optional completion
295+
/// handler callback is invoked after the attempted activation of data, if the fetch call succeeded.
296+
///
297+
/// Note: This method uses a Firebase Installations token to identify the app instance, and once
298+
/// it's called, it periodically sends data to the Firebase backend. (see
299+
/// `Installations.authToken(completion:)`).
300+
/// To stop the periodic sync, call `Installations.delete(completion:)`
301+
/// and avoid calling this method again.
302+
///
303+
/// @param completionHandler Fetch operation callback with status and error parameters.
304+
- (void)fetchAndActivateWithCompletionHandler:
305+
(void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchAndActivateStatus status,
306+
NSError *_Nullable error))completionHandler;
307+
#else
256308
/// Fetches Remote Config data and if successful, activates fetched data. Optional completion
257309
/// handler callback is invoked after the attempted activation of data, if the fetch call succeeded.
258310
///
@@ -266,14 +318,23 @@ NS_SWIFT_NAME(RemoteConfig)
266318
- (void)fetchAndActivateWithCompletionHandler:
267319
(void (^_Nullable)(FIRRemoteConfigFetchAndActivateStatus status,
268320
NSError *_Nullable error))completionHandler;
321+
#endif
269322

270323
#pragma mark - Apply
271324

325+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
326+
/// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance
327+
/// of the app to take effect (depending on how config data is used in the app).
328+
/// @param completion Activate operation callback with changed and error parameters.
329+
- (void)activateWithCompletion:
330+
(void (^_Nullable NS_SWIFT_SENDABLE)(BOOL changed, NSError *_Nullable error))completion;
331+
#else
272332
/// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance
273333
/// of the app to take effect (depending on how config data is used in the app).
274334
/// @param completion Activate operation callback with changed and error parameters.
275335
- (void)activateWithCompletion:(void (^_Nullable)(BOOL changed,
276336
NSError *_Nullable error))completion;
337+
#endif
277338

278339
#pragma mark - Get Config
279340
/// Enables access to configuration values by using object subscripting syntax.

0 commit comments

Comments
 (0)