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);
                }
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public void handler(RemoteConfigFetchStatus status, NSError error)
 {
 }
 public RemoteConfigInfo(RemoteConfigSettings configSettings, DateTimeOffset lastFetchTime, RemoteConfigFetchStatus lastFetchStatus)
 {
     ConfigSettings  = configSettings;
     LastFetchTime   = lastFetchTime;
     LastFetchStatus = lastFetchStatus;
 }