diff --git a/FirebaseRemoteConfig/CHANGELOG.md b/FirebaseRemoteConfig/CHANGELOG.md index 48ce504441b..a90bc0d3828 100644 --- a/FirebaseRemoteConfig/CHANGELOG.md +++ b/FirebaseRemoteConfig/CHANGELOG.md @@ -1,6 +1,9 @@ -# Unreleased +# 11.7.0 - [fixed] Mark ConfigUpdateListenerRegistration Sendable. (#14215) -- [feature] Added support for custom signal targeting in Remote Config. Use `setCustomSignals` API for setting custom signals and use them to build custom targeting conditions in Remote Config. (#13976) +- [fixed] Mark completion handlers as Sendable in RemoteConfig class. (#14257) +- [feature] Added support for custom signal targeting in Remote Config. Use + `setCustomSignals` API for setting custom signals and use them to build + custom targeting conditions in Remote Config. (#13976) # 11.5.0 - [fixed] Mark two internal properties as `atomic` to prevent concurrency diff --git a/FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h b/FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h index 0fc934eecb0..ee3d4036526 100644 --- a/FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h +++ b/FirebaseRemoteConfig/Sources/Public/FirebaseRemoteConfig/FIRRemoteConfig.h @@ -236,6 +236,22 @@ NS_SWIFT_NAME(RemoteConfig) - (void)ensureInitializedWithCompletionHandler: (void (^_Nonnull)(NSError *_Nullable initializationError))completionHandler; #pragma mark - Fetch + +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) +/// Fetches Remote Config data with a callback. Call `activate()` to make fetched data +/// available to your app. +/// +/// Note: This method uses a Firebase Installations token to identify the app instance, and once +/// it's called, it periodically sends data to the Firebase backend. (see +/// `Installations.authToken(completion:)`). +/// To stop the periodic sync, call `Installations.delete(completion:)` +/// and avoid calling this method again. +/// +/// @param completionHandler Fetch operation callback with status and error parameters. +- (void)fetchWithCompletionHandler: + (void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchStatus status, + NSError *_Nullable error))completionHandler; +#else /// Fetches Remote Config data with a callback. Call `activate()` to make fetched data /// available to your app. /// @@ -248,7 +264,27 @@ NS_SWIFT_NAME(RemoteConfig) /// @param completionHandler Fetch operation callback with status and error parameters. - (void)fetchWithCompletionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status, NSError *_Nullable error))completionHandler; +#endif +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) +/// Fetches Remote Config data and sets a duration that specifies how long config data lasts. +/// Call `activateWithCompletion:` to make fetched data available to your app. +/// +/// Note: This method uses a Firebase Installations token to identify the app instance, and once +/// it's called, it periodically sends data to the Firebase backend. (see +/// `Installations.authToken(completion:)`). +/// To stop the periodic sync, call `Installations.delete(completion:)` +/// and avoid calling this method again. +/// +/// @param expirationDuration Override the (default or optionally set `minimumFetchInterval` +/// property in RemoteConfigSettings) `minimumFetchInterval` for only the current request, in +/// seconds. Setting a value of 0 seconds will force a fetch to the backend. +/// @param completionHandler Fetch operation callback with status and error parameters. +- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration + completionHandler:(void (^_Nullable NS_SWIFT_SENDABLE)( + FIRRemoteConfigFetchStatus status, + NSError *_Nullable error))completionHandler; +#else /// Fetches Remote Config data and sets a duration that specifies how long config data lasts. /// Call `activateWithCompletion:` to make fetched data available to your app. /// @@ -265,7 +301,23 @@ NS_SWIFT_NAME(RemoteConfig) - (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration completionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status, NSError *_Nullable error))completionHandler; +#endif +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) +/// Fetches Remote Config data and if successful, activates fetched data. Optional completion +/// handler callback is invoked after the attempted activation of data, if the fetch call succeeded. +/// +/// Note: This method uses a Firebase Installations token to identify the app instance, and once +/// it's called, it periodically sends data to the Firebase backend. (see +/// `Installations.authToken(completion:)`). +/// To stop the periodic sync, call `Installations.delete(completion:)` +/// and avoid calling this method again. +/// +/// @param completionHandler Fetch operation callback with status and error parameters. +- (void)fetchAndActivateWithCompletionHandler: + (void (^_Nullable NS_SWIFT_SENDABLE)(FIRRemoteConfigFetchAndActivateStatus status, + NSError *_Nullable error))completionHandler; +#else /// Fetches Remote Config data and if successful, activates fetched data. Optional completion /// handler callback is invoked after the attempted activation of data, if the fetch call succeeded. /// @@ -279,14 +331,23 @@ NS_SWIFT_NAME(RemoteConfig) - (void)fetchAndActivateWithCompletionHandler: (void (^_Nullable)(FIRRemoteConfigFetchAndActivateStatus status, NSError *_Nullable error))completionHandler; +#endif #pragma mark - Apply +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) +/// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance +/// of the app to take effect (depending on how config data is used in the app). +/// @param completion Activate operation callback with changed and error parameters. +- (void)activateWithCompletion: + (void (^_Nullable NS_SWIFT_SENDABLE)(BOOL changed, NSError *_Nullable error))completion; +#else /// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance /// of the app to take effect (depending on how config data is used in the app). /// @param completion Activate operation callback with changed and error parameters. - (void)activateWithCompletion:(void (^_Nullable)(BOOL changed, NSError *_Nullable error))completion; +#endif #pragma mark - Get Config /// Enables access to configuration values by using object subscripting syntax.