Is there no continuation action "ContinueWithOnMainThread" in 6.12.0 unity sdk?

Viewed 2281

I'm using firestore latest sdk "6.12.0" on unity. I've to get the data from the database and save it to PlayerPrefs but because PlayerPrefs only run on the main thread, it is causing an error to go with older "ContinueWith" continuation action.

Firebase has given this "ContinueWithOnMainThread" in the doc but I'm unable to find it on API. I only get the option of "ContinueWith".

What's the issue, does "ContinueWithOnMainThread" exist in 6.12.0?

1 Answers

My bad...

Actually, You have to use Firebase.Extensions API to get the "ContinueWithOnMainThread" function:

using Firebase.Extensions;

void Start(){
  Firebase.FirebaseApp.CheckAndFixDependenciesAsync()
    .ContinueWithOnMainThread(fixTask=>{
      Debug.Log("we are in main thread");
    })
}

The documentation is also available.

Related