Skip to content

Improve real-time reference docs. #4808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
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 @@ -18,10 +18,7 @@
import com.google.auto.value.AutoValue;
import java.util.Set;

/**
* Information about the updated config passed to the {@code onUpdate} callback of {@link
* ConfigUpdateListener}.
*/
/** Information about the updated config passed to {@link ConfigUpdateListener#onUpdate}. */
@AutoValue
public abstract class ConfigUpdate {
@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
import javax.annotation.Nonnull;

/**
* Event listener interface for real-time RC updates. Implement {@code ConfigUpdateListner} to call
* {@link com.google.firebase.remoteconfig.FirebaseRemoteConfig#addOnConfigUpdateListener}.
* Event listener interface for real-time Remote Config updates. Implement {@link
* ConfigUpdateListener} to call {@link
* com.google.firebase.remoteconfig.FirebaseRemoteConfig#addOnConfigUpdateListener}.
*/
public interface ConfigUpdateListener {
/**
* Callback for when a new config has been automatically fetched from the backend and has changed
* from the activated config.
* Callback for when a new config version has been automatically fetched from the backend and has
* changed from the activated config.
*
* @param configUpdate A {@link ConfigUpdate} with information about the updated config, including
* the set of updated parameters.
* @param configUpdate A {@link ConfigUpdate} with information about the updated config version,
* including the set of updated parameters.
*/
void onUpdate(@NonNull ConfigUpdate configUpdate);

/**
* Callback for when an error occurs while listening or fetching a config update.
* Callback for when an error occurs while listening for updates or fetching the latest version of
* the config.
*
* @param error A {@link FirebaseRemoteConfigException} with information about the error.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,21 +549,21 @@ public Task<Void> reset() {
}

/**
* Start listening for real-time config updates from the Remote Config backend and automatically
* fetch updates from the RC backend when they are available.
* Starts listening for real-time config updates from the Remote Config backend and automatically
* fetches updates from the RC backend when they are available.
*
* <p>If a connection to the Remote Config backend is not already open, calling this method will
* open it. Multiple listeners can be added by calling this method again, but subsequent calls
* re-use the same connection to the backend.
*
* <p>Note: Real-time Remote Config requires the Firebase Remote Config Realtime API. See the <a
* href="https://firebase.google.com/docs/remote-config/get-started">Remote Config Get Started
* </a> guide to enable the API.
* href="https://firebase.google.com/docs/remote-config/get-started#add-real-time-listener">Remote
* Config Get Started </a> guide to enable the API.
*
* @param configUpdateListener A {@link ConfigUpdateListener} that can be used to respond to
* config updates when they're fetched.
* @return A {@link ConfigUpdateListenerRegistration} that allows the user to remove the added
* {@code configUpdateListener} and close the connection when there are no more listeners.
* @return A {@link ConfigUpdateListenerRegistration} that allows you to remove the added {@code
* configUpdateListener} and close the connection when there are no more listeners.
*/
@NonNull
public ConfigUpdateListenerRegistration addOnConfigUpdateListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public FirebaseRemoteConfigClientException(@NonNull String detailMessage, @NonNu

/**
* Creates a Firebase Remote Config client exception with the given message, exception cause, and
* FirebaseRemoteConfigException code.
* {@code FirebaseRemoteConfigException} code.
*/
public FirebaseRemoteConfigClientException(
@NonNull String detailMessage, @Nullable Throwable cause, @NonNull Code code) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public FirebaseRemoteConfigServerException(
}

/**
* Creates a Firebase Remote Config server exception with the given message and
* FirebaseRemoteConfigException code.
* Creates a Firebase Remote Config server exception with the given message and {@code
* FirebaseRemoteConfigException} code.
*/
public FirebaseRemoteConfigServerException(@NonNull String detailMessage, @Nonnull Code code) {
super(detailMessage, code);
Expand All @@ -55,7 +55,7 @@ public FirebaseRemoteConfigServerException(@NonNull String detailMessage, @Nonnu

/**
* Creates a Firebase Remote Config server exception with the HTTP status code, given message, and
* FirebaseRemoteConfigException code.
* {@code FirebaseRemoteConfigException} code.
*/
public FirebaseRemoteConfigServerException(
int httpStatusCode, @NonNull String detailMessage, @Nonnull Code code) {
Expand All @@ -65,7 +65,7 @@ public FirebaseRemoteConfigServerException(

/**
* Creates a Firebase Remote Config server exception with the given message, exception cause, and
* FirebaseRemoteConfigException code.
* {@code FirebaseRemoteConfigException} code.
*/
public FirebaseRemoteConfigServerException(
@NonNull String detailMessage, @Nullable Throwable cause, @NonNull Code code) {
Expand All @@ -75,7 +75,7 @@ public FirebaseRemoteConfigServerException(

/**
* Creates a Firebase Remote Config server exception with the HTTP status code, given message,
* exception cause, and FirebaseRemoteConfigException code.
* exception cause, and {@code FirebaseRemoteConfigException} code.
*/
public FirebaseRemoteConfigServerException(
int httpStatusCode,
Expand Down