Skip to content

Commit 4b99774

Browse files
authored
[Config] Mark addOnConfigUpdateListener as Sendable (#14375)
1 parent 92f5241 commit 4b99774

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

FirebaseRemoteConfig/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- [fixed] Mark completion handlers as Sendable in RemoteConfig class.
3+
Some completions handlers were missed in the 11.7.0 update. (#14257)
4+
15
# 11.7.0
26
- [fixed] Mark ConfigUpdateListenerRegistration Sendable. (#14215)
37
- [fixed] Mark completion handlers as Sendable in RemoteConfig class. (#14257)

FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h

+28
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,18 @@ NS_SWIFT_NAME(RemoteConfig)
231231
/// Unavailable. Use +remoteConfig instead.
232232
- (nonnull instancetype)init __attribute__((unavailable("Use +remoteConfig instead.")));
233233

234+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
235+
/// Ensures initialization is complete and clients can begin querying for Remote Config values.
236+
/// @param completionHandler Initialization complete callback with error parameter.
237+
- (void)ensureInitializedWithCompletionHandler:
238+
(void (^_Nonnull NS_SWIFT_SENDABLE)(NSError *_Nullable initializationError))completionHandler;
239+
#else
234240
/// Ensures initialization is complete and clients can begin querying for Remote Config values.
235241
/// @param completionHandler Initialization complete callback with error parameter.
236242
- (void)ensureInitializedWithCompletionHandler:
237243
(void (^_Nonnull)(NSError *_Nullable initializationError))completionHandler;
244+
#endif
245+
238246
#pragma mark - Fetch
239247

240248
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
@@ -414,6 +422,25 @@ typedef void (^FIRRemoteConfigUpdateCompletion)(FIRRemoteConfigUpdate *_Nullable
414422
NSError *_Nullable error)
415423
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
416424

425+
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
426+
/// Start listening for real-time config updates from the Remote Config backend and automatically
427+
/// fetch updates when they're available.
428+
///
429+
/// If a connection to the Remote Config backend is not already open, calling this method will
430+
/// open it. Multiple listeners can be added by calling this method again, but subsequent calls
431+
/// re-use the same connection to the backend.
432+
///
433+
/// Note: Real-time Remote Config requires the Firebase Remote Config Realtime API. See Get started
434+
/// with Firebase Remote Config at https://firebase.google.com/docs/remote-config/get-started for
435+
/// more information.
436+
///
437+
/// @param listener The configured listener that is called for every config update.
438+
/// @return Returns a registration representing the listener. The registration contains
439+
/// a remove method, which can be used to stop receiving updates for the provided listener.
440+
- (FIRConfigUpdateListenerRegistration *_Nonnull)addOnConfigUpdateListener:
441+
(FIRRemoteConfigUpdateCompletion _Nonnull NS_SWIFT_SENDABLE)listener
442+
NS_SWIFT_NAME(addOnConfigUpdateListener(remoteConfigUpdateCompletion:));
443+
#else
417444
/// Start listening for real-time config updates from the Remote Config backend and automatically
418445
/// fetch updates when they're available.
419446
///
@@ -431,6 +458,7 @@ typedef void (^FIRRemoteConfigUpdateCompletion)(FIRRemoteConfigUpdate *_Nullable
431458
- (FIRConfigUpdateListenerRegistration *_Nonnull)addOnConfigUpdateListener:
432459
(FIRRemoteConfigUpdateCompletion _Nonnull)listener
433460
NS_SWIFT_NAME(addOnConfigUpdateListener(remoteConfigUpdateCompletion:));
461+
#endif
434462

435463
- (void)setCustomSignals:(nonnull NSDictionary<NSString *, NSObject *> *)customSignals
436464
withCompletion:(void (^_Nullable)(NSError *_Nullable error))completionHandler

0 commit comments

Comments
 (0)