void HandleRemoteConfigFetchCompletionHandler(RemoteConfigFetchStatus status, NSError error) { switch (status) { case RemoteConfigFetchStatus.Success: AppDelegate.ShowMessage("Config Fetched!", "Settings will be updated", NavigationController, OkAction); break; case RemoteConfigFetchStatus.Throttled: case RemoteConfigFetchStatus.NoFetchYet: case RemoteConfigFetchStatus.Failure: AppDelegate.ShowMessage("Config not fetched...", error.LocalizedDescription, NavigationController, null); break; } UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; void OkAction() { remoteConfig.ActivateFetched(); var indexPaths = TableView.IndexPathsForVisibleRows; foreach (var indexPath in indexPaths) { var cell = TableView.CellAt(indexPath) as SettingTableViewCell; var enabled = indexPath.Row == 0 ? remoteConfig ["perf_enable_auto"].BoolValue : remoteConfig ["perf_enable_manual"].BoolValue; cell.SetEnabled(enabled, true); } } }
public string GetRemoteDataString(string key) { try { InitRemoteConfig(); firebaseRemoteConfig.Fetch(new RemoteConfigFetchCompletionHandler(handler)); firebaseRemoteConfig.ActivateFetched(); return(firebaseRemoteConfig.GetConfigValue(key).StringValue); } catch (Exception ex) { return("all"); } }
public async Task <bool> Fetch() { _result?.TrySetCanceled(); _result = new TaskCompletionSource <bool>(); _firebaseConfig.Fetch(0, (status, error) => { if (status == RemoteConfigFetchStatus.Success) { _firebaseConfig.ActivateFetched(); _result.SetResult(true); } else { _result.SetResult(false); } }); return(await _result.Task); }
void HandleRemoteConfigFetchCompletionHandler(RemoteConfigFetchStatus status, NSError error) { if (status == RemoteConfigFetchStatus.Success) { ToastIOS.Toast.MakeText("Success"); remoteConfigText.Text = remoteConfig["remote_text"].StringValue; var activate_fetched = RemoteConfig.SharedInstance.ActivateFetched(); if (remoteConfig.ActivateFetched()) { remoteConfigText.Text = remoteConfig["remote_text"].StringValue; } } else { ToastIOS.Toast.MakeText("Error " + error.Description); } }
public void ActivateFetched() => _config.ActivateFetched();