@@ -151,7 +151,9 @@ void SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_default
151151 FIREBASE_ASSERT_RETURN (std::string (), internal::IsInitialized ());
152152 switch (setting) {
153153 case kConfigSettingDeveloperMode :
154- return g_remote_config_instance.configSettings .isDeveloperModeEnabled ? " 1" : " 0" ;
154+ // This setting is deprecated.
155+ LogWarning (" Remote Config: Developer mode setting is deprecated." );
156+ return " 1" ;
155157 default :
156158 LogError (" Remote Config: GetConfigSetting called with unknown setting: %d" , setting);
157159 return std::string ();
@@ -161,8 +163,7 @@ void SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_default
161163void SetConfigSetting (ConfigSetting setting, const char *value) {
162164 switch (setting) {
163165 case kConfigSettingDeveloperMode :
164- g_remote_config_instance.configSettings =
165- [[FIRRemoteConfigSettings alloc ] initWithDeveloperModeEnabled: @(value).boolValue];
166+ LogWarning (" Remote Config: Developer mode setting is deprecated." );
166167 break ;
167168 default :
168169 LogError (" Remote Config: SetConfigSetting called with unknown setting: %d" , setting);
@@ -309,7 +310,7 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
309310Future<void > Fetch (uint64_t cache_expiration_in_seconds) {
310311 FIREBASE_ASSERT_RETURN (FetchLastResult (), internal::IsInitialized ());
311312 ReferenceCountedFutureImpl *api = FutureData::Get ()->api ();
312- const FutureHandle handle = api->Alloc <void >(kRemoteConfigFnFetch );
313+ const auto handle = api->SafeAlloc <void >(kRemoteConfigFnFetch );
313314
314315 FIRRemoteConfigFetchCompletion completion = ^(FIRRemoteConfigFetchStatus status, NSError *error) {
315316 if (error) {
@@ -327,13 +328,13 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
327328 " Fetch encountered an error." );
328329 } else {
329330 // Everything worked!
330- api->Complete (handle, kFetchFutureStatusSuccess , nullptr );
331+ api->Complete (handle, kFetchFutureStatusSuccess );
331332 }
332333 };
333334 [g_remote_config_instance fetchWithExpirationDuration: cache_expiration_in_seconds
334335 completionHandler: completion];
335336
336- return static_cast < const Future< void > &> (api-> LastResult ( kRemoteConfigFnFetch ) );
337+ return MakeFuture< void >(api, handle );
337338}
338339
339340Future<void > FetchLastResult () {
@@ -344,7 +345,14 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
344345
345346bool ActivateFetched () {
346347 FIREBASE_ASSERT_RETURN (false , internal::IsInitialized ());
347- return static_cast <bool >([g_remote_config_instance activateFetched ]);
348+ __block bool succeeded = true ;
349+ __block dispatch_semaphore_t semaphore = dispatch_semaphore_create (0 );
350+ [g_remote_config_instance activateWithCompletionHandler: ^(NSError *_Nullable error) {
351+ if (error) succeeded = false ;
352+ dispatch_semaphore_signal (semaphore);
353+ }];
354+ dispatch_semaphore_wait (semaphore, DISPATCH_TIME_FOREVER);
355+ return succeeded;
348356}
349357
350358const ConfigInfo &GetInfo () {
0 commit comments