# Firebase and Tasks, how to deal with asynchronous logic in Unity

DevFeed: [Firebase and Tasks, how to deal with asynchronous logic in Unity](<https://devfeed.tech/articles/firebase-and-tasks-how-to-deal-with-asynchronous-logic-in-unity-16321.md>)

Original publisher: [Read original article](<https://firebase.blog/posts/2019/07/firebase-and-tasks-how-to-deal-with>)

Author: Patrick Martin

Published: 2019-07-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Firebase Blog](<https://devfeed.tech/sources/firebase-blog.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Unity](<https://devfeed.tech/topics/unity.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [SDK](<https://devfeed.tech/topics/sdk.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [exception](<https://devfeed.tech/tags/exception.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [unity](<https://devfeed.tech/tags/unity.md>)

## AI overview

A tutorial on safely handling asynchronous Firebase Unity SDK calls. It explains how background I/O can resume on a non-main thread, causing Unity operations to fail, and shows how to use TaskScheduler continuations to return execution to Unity's main thread.

## Source excerpt

News, tutorials, and updates from the Firebase team.