Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern NSString *const _Nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey NS_S

/**
* Listener registration returned by `addOnConfigUpdateListener`. Calling its method `remove` stops
* the listener from receiving config updates and unregisters itself.
* the associated listener from receiving config updates and unregisters itself.
*
* If remove is called and no other listener registrations remain, the connection to the real-time
* RC backend is closed. Subsequently calling `addOnConfigUpdateListener` will re-open the
Expand All @@ -41,8 +41,8 @@ extern NSString *const _Nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey NS_S
NS_SWIFT_NAME(ConfigUpdateListenerRegistration)
@interface FIRConfigUpdateListenerRegistration : NSObject
/**
* Removes the listener being tracked by this `ConfigUpdateListenerRegistration`. After the initial
* call, subsequent calls have no effect.
* Removes the listener associated with this `ConfigUpdateListenerRegistration`. After the
* initial call, subsequent calls have no effect.
*/
- (void)remove;
@end
Expand Down Expand Up @@ -82,17 +82,17 @@ typedef NS_ERROR_ENUM(FIRRemoteConfigErrorDomain, FIRRemoteConfigError){
FIRRemoteConfigErrorInternalError = 8003,
} NS_SWIFT_NAME(RemoteConfigError);

/// Remote Config error domain that handles errors for the real-time service.
/// Remote Config error domain that handles errors for the real-time config update service.
extern NSString *const _Nonnull FIRRemoteConfigUpdateErrorDomain NS_SWIFT_NAME(RemoteConfigUpdateErrorDomain);
/// Firebase Remote Config real-time service error.
/// Firebase Remote Config real-time config update service error.
typedef NS_ERROR_ENUM(FIRRemoteConfigUpdateErrorDomain, FIRRemoteConfigUpdateError){
/// Unable to make a connection to the backend.
/// Unable to make a connection to the Remote Config backend.
FIRRemoteConfigUpdateErrorStreamError = 8001,
/// Unable to fetch the latest config.
/// Unable to fetch the latest version of the config.
FIRRemoteConfigUpdateErrorNotFetched = 8002,
/// The ConfigUpdate message was unparsable.
FIRRemoteConfigUpdateErrorMessageInvalid = 8003,
/// The real-time Remote Config service is unavailable.
/// The Remote Config real-time config update service is unavailable.
FIRRemoteConfigUpdateErrorUnavailable = 8004,
} NS_SWIFT_NAME(RemoteConfigUpdateError);

Expand Down Expand Up @@ -171,7 +171,9 @@ NS_SWIFT_NAME(RemoteConfigSettings)
@end

#pragma mark - FIRRemoteConfigUpdate
/// Firebase Remote Config update
/// Used by Remote Config real-time config update service, this class represents changes between the
/// newly fetched config and the current one. An instance of this class is passed to
/// `FIRRemoteConfigUpdateCompletion` when a new config version has been automatically fetched.
NS_SWIFT_NAME(RemoteConfigUpdate)
@interface FIRRemoteConfigUpdate : NSObject

Expand Down Expand Up @@ -325,12 +327,13 @@ NS_SWIFT_NAME(RemoteConfig)
/// nil if the key doesn't exist in the default config.
- (nullable FIRRemoteConfigValue *)defaultValueForKey:(nullable NSString *)key;

#pragma mark - Realtime
#pragma mark - Real-time Config Updates

/// Completion handler invoked by `addOnConfigUpdateListener` when there is an update to
/// the config from the backend.
///
/// @param configUpdate Information on which key's values have changed
/// @param configUpdate An instance of `FIRRemoteConfigUpdate` that contains information on which
/// key's values have changed.
/// @param error Error message on failure.
typedef void (^FIRRemoteConfigUpdateCompletion)(FIRRemoteConfigUpdate *_Nullable configUpdate,
NSError *_Nullable error)
Expand All @@ -349,8 +352,7 @@ typedef void (^FIRRemoteConfigUpdateCompletion)(FIRRemoteConfigUpdate *_Nullable
///
/// @param listener The configured listener that is called for every config update.
/// @return Returns a registration representing the listener. The registration contains
/// a remove method, which can be used to stop receiving for updates for this particular
/// registration.
/// a remove method, which can be used to stop receiving updates for the provided listener.
- (FIRConfigUpdateListenerRegistration *_Nonnull)addOnConfigUpdateListener:
(FIRRemoteConfigUpdateCompletion _Nonnull)listener
NS_SWIFT_NAME(addOnConfigUpdateListener(remoteConfigUpdateCompletion:));
Expand Down