Firebase RemoteConfig FetchTime在Unity上不起作用

时间:2017-04-18 08:39:50

标签: firebase unity3d fetch firebase-remote-config

我正在尝试在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;
    }
}

0 个答案:

没有答案