1

我正在尝试在 Unity 上获取最新的 Firebase 远程配置获取时间。

Firebase.RemoteConfig.FirebaseRemoteConfig.Info.FetchTime 不起作用。我无法 debug.log 日期。

任何解决方法将不胜感激。

在我尝试调试代码停止运行的日期之后。

public void FetchData ()
{
    System.Threading.Tasks.Task fetchTask = Firebase.RemoteConfig.FirebaseRemoteConfig.FetchAsync (
                                                TimeSpan.Zero);
    Firebase.RemoteConfig.FirebaseRemoteConfig.FetchAsync ();

    fetchTask.ContinueWith (FetchComplete);
}


void FetchComplete (Task fetchTask)
{
    if (fetchTask.IsCanceled) {
        DebugLog ("Fetch canceled.");
    } else if (fetchTask.IsFaulted) {
        DebugLog ("Fetch encountered an error.");
    } else if (fetchTask.IsCompleted) {
        DebugLog ("Fetch completed successfully!");

    }

    switch (Firebase.RemoteConfig.FirebaseRemoteConfig.Info.LastFetchStatus) {
    case Firebase.RemoteConfig.LastFetchStatus.Success:
        Firebase.RemoteConfig.FirebaseRemoteConfig.ActivateFetched ();

//This is where my problem is!!!!!!!!!!
        DebugLog (" Last Fetch Date: " + Firebase.RemoteConfig.FirebaseRemoteConfig.Info.FetchTime);

        DebugLog ("Remote data loaded and ready.");
        SetAllValues ();
        break;
    case Firebase.RemoteConfig.LastFetchStatus.Failure:
        switch (Firebase.RemoteConfig.FirebaseRemoteConfig.Info.LastFetchFailureReason) {
        case Firebase.RemoteConfig.FetchFailureReason.Error:
            DebugLog ("Fetch failed for unknown reason");
            break;
        case Firebase.RemoteConfig.FetchFailureReason.Throttled:
            DebugLog ("Fetch throttled until " +
            Firebase.RemoteConfig.FirebaseRemoteConfig.Info.ThrottledEndTime);
            break;
        }
        break;
    case Firebase.RemoteConfig.LastFetchStatus.Pending:
        DebugLog ("Latest Fetch call still pending.");
        break;
    }
}
4

0 回答 0