Skip to content

Commit dbe9007

Browse files
authored
Better Swift API completion usability (#5748)
1 parent 2037775 commit dbe9007

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

FirebaseRemoteConfig/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v4.5.1
2+
- [changed] Removed typedefs from public API method signatures to improve Swift API usage from Xcode. (#5748)
3+
14
# v4.5.0
25
- [changed] Updated `fetchAndActivateWithCompletionHandler:` implementation to activate asynchronously. (#5617)
36
- [fixed] Remove undefined class via removing unused proto generated source files. (#4334)

FirebaseRemoteConfig/Sources/Public/FIRRemoteConfig.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ NS_SWIFT_NAME(RemoteConfig)
185185
- (nonnull instancetype)init __attribute__((unavailable("Use +remoteConfig instead.")));
186186

187187
/// Ensures initialization is complete and clients can begin querying for Remote Config values.
188-
/// @param completionHandler Initialization complete callback.
188+
/// @param completionHandler Initialization complete callback with error parameter.
189189
- (void)ensureInitializedWithCompletionHandler:
190-
(nonnull FIRRemoteConfigInitializationCompletion)completionHandler;
190+
(void (^_Nonnull)(NSError *_Nullable initializationError))completionHandler;
191191
#pragma mark - Fetch
192192
/// Fetches Remote Config data with a callback. Call activateFetched to make fetched data available
193193
/// to your app.
@@ -198,8 +198,9 @@ NS_SWIFT_NAME(RemoteConfig)
198198
/// To stop the periodic sync, developers need to call `[FIRInstallations deleteWithCompletion:]`
199199
/// and avoid calling this method again.
200200
///
201-
/// @param completionHandler Fetch operation callback.
202-
- (void)fetchWithCompletionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler;
201+
/// @param completionHandler Fetch operation callback with status and error parameters.
202+
- (void)fetchWithCompletionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
203+
NSError *_Nullable error))completionHandler;
203204

204205
/// Fetches Remote Config data and sets a duration that specifies how long config data lasts.
205206
/// Call activateFetched to make fetched data available to your app.
@@ -213,9 +214,10 @@ NS_SWIFT_NAME(RemoteConfig)
213214
/// @param expirationDuration Override the (default or optionally set minimumFetchInterval property
214215
/// in FIRRemoteConfigSettings) minimumFetchInterval for only the current request, in seconds.
215216
/// Setting a value of 0 seconds will force a fetch to the backend.
216-
/// @param completionHandler Fetch operation callback.
217+
/// @param completionHandler Fetch operation callback with status and error parameters.
217218
- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration
218-
completionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler;
219+
completionHandler:(void (^_Nullable)(FIRRemoteConfigFetchStatus status,
220+
NSError *_Nullable error))completionHandler;
219221

220222
/// Fetches Remote Config data and if successful, activates fetched data. Optional completion
221223
/// handler callback is invoked after the attempted activation of data, if the fetch call succeeded.
@@ -226,9 +228,10 @@ NS_SWIFT_NAME(RemoteConfig)
226228
/// To stop the periodic sync, developers need to call `[FIRInstallations deleteWithCompletion:]`
227229
/// and avoid calling this method again.
228230
///
229-
/// @param completionHandler Fetch operation callback.
231+
/// @param completionHandler Fetch operation callback with status and error parameters.
230232
- (void)fetchAndActivateWithCompletionHandler:
231-
(nullable FIRRemoteConfigFetchAndActivateCompletion)completionHandler;
233+
(void (^_Nullable)(FIRRemoteConfigFetchAndActivateStatus status,
234+
NSError *_Nullable error))completionHandler;
232235

233236
#pragma mark - Apply
234237

0 commit comments

Comments
 (0)