@@ -151,7 +151,9 @@ void SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_default
151
151
FIREBASE_ASSERT_RETURN (std::string (), internal::IsInitialized ());
152
152
switch (setting) {
153
153
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" ;
155
157
default :
156
158
LogError (" Remote Config: GetConfigSetting called with unknown setting: %d" , setting);
157
159
return std::string ();
@@ -161,8 +163,7 @@ void SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_default
161
163
void SetConfigSetting (ConfigSetting setting, const char *value) {
162
164
switch (setting) {
163
165
case kConfigSettingDeveloperMode :
164
- g_remote_config_instance.configSettings =
165
- [[FIRRemoteConfigSettings alloc ] initWithDeveloperModeEnabled: @(value).boolValue];
166
+ LogWarning (" Remote Config: Developer mode setting is deprecated." );
166
167
break ;
167
168
default :
168
169
LogError (" Remote Config: SetConfigSetting called with unknown setting: %d" , setting);
@@ -309,7 +310,7 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
309
310
Future<void > Fetch (uint64_t cache_expiration_in_seconds) {
310
311
FIREBASE_ASSERT_RETURN (FetchLastResult (), internal::IsInitialized ());
311
312
ReferenceCountedFutureImpl *api = FutureData::Get ()->api ();
312
- const FutureHandle handle = api->Alloc <void >(kRemoteConfigFnFetch );
313
+ const auto handle = api->SafeAlloc <void >(kRemoteConfigFnFetch );
313
314
314
315
FIRRemoteConfigFetchCompletion completion = ^(FIRRemoteConfigFetchStatus status, NSError *error) {
315
316
if (error) {
@@ -327,13 +328,13 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
327
328
" Fetch encountered an error." );
328
329
} else {
329
330
// Everything worked!
330
- api->Complete (handle, kFetchFutureStatusSuccess , nullptr );
331
+ api->Complete (handle, kFetchFutureStatusSuccess );
331
332
}
332
333
};
333
334
[g_remote_config_instance fetchWithExpirationDuration: cache_expiration_in_seconds
334
335
completionHandler: completion];
335
336
336
- return static_cast < const Future< void > &> (api-> LastResult ( kRemoteConfigFnFetch ) );
337
+ return MakeFuture< void >(api, handle );
337
338
}
338
339
339
340
Future<void > FetchLastResult () {
@@ -344,7 +345,14 @@ static void CheckDoubleConversion(FIRRemoteConfigValue *value, ValueInfo *info)
344
345
345
346
bool ActivateFetched () {
346
347
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;
348
356
}
349
357
350
358
const ConfigInfo &GetInfo () {
0 commit comments