setMinimumFetchIntervalInSeconds 和 fetch(long minimumFetchIntervalInSeconds) 之间的确切区别是什么

What is the exact difference between setMinimumFetchIntervalInSeconds and fetch(long minimumFetchIntervalInSeconds)

FirebaseRemoteConfig中有两个minimumFetchIntervalInSeconds

  1. FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(long duration)
  2. FirebaseRemoteConfig.fetch(long minimumFetchIntervalInSeconds)

除了 document 中解释的优先级之外,它们之间的确切区别是什么?我应该同时使用它们还是只使用其中一个就足够了?

mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();

FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings
        .Builder()
        .setMinimumFetchIntervalInSeconds(mCacheExpiration) // <-- (1)
        .build();
mFirebaseRemoteConfig.setConfigSettingsAsync(configSettings);

mFirebaseRemoteConfig.fetch(mCacheExpiration); // <-- (2)

如果您使用 setMinimumFetchIntervalInSeconds,您稍后可以调用 mFirebaseRemoteConfig.fetch() 而无需指定过期时间。然后它将使用您之前指定的那个。另见 here

fetch(long minimumFetchIntervalInSeconds)

Starts fetching configs, adhering to the specified minimum fetch interval.

fetch()

Starts fetching configs, adhering to the default minimum fetch interval.

注意 here 它实际上是说

The default minimum fetch interval can be set with FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)