Getting started with Firebase in Unity (2019) - Firecasts

Firebase · 195K views · 2019 · 12:54

Open on YouTube

Indie game developmentGame programming & enginesWeb developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the setup tutorial for Firebase in Unity, and Firebase's own Patrick Martin points people to it when answering initialization, dependency and Cloud Storage questions.

Recommended by 1 people across 3 different months, 2019 to 2020.

What it is

A 2019 Firecasts episode in which Firebase team member Patrick Martin walks through configuring a Unity project with Firebase and deploying it to both Android and iOS. It covers the SDK setup, dependency handling, and authentication basics.

What people said

Recommends Patrick Martin · 2019-12 · Stack Overflow · on “This app is not authorized to use Firebase Authentication - Reg”

This sounds like you need to re-upload your SHA 1 for Android development. The easiest way to do this is to use the keytool command installed with Java: keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore The password for your debug keystore will be android , but if you're doing a signed release build (say for the Play Store), you'll want to use the appropriate keystore and credentials. You then need to copy/paste the SHA-1 into the "SHA certificate fingerprint" field under project settings. There is another great stack overflow answer here [LINK] , but it is very Android Studio centric (you may not have it installed when developing in Unity). I cover this at about th

Recommends Patrick Martin · 2019-12 · Stack Overflow · on “Unity in android: failed to read firebase options from the app's resources”

Try forcing the Play Services Resolver to run. See this: [LINK] It may also help to follow this video: [this video] If you're still having issues, try to enable verbose logging for the play services resolver and post any messages that may occur. Also try to avoid any special folder names and post an update if that fixes it: [LINK] (obviously it has to be in Assets, but avoid "Editor" for instance).

Recommends Patrick Martin · 2020-04 · Stack Overflow · on “Firebase doesn't show connected user”

The first thing to do is double check that the task completed successfully. You can do this by saying: FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => { if (task.Exception != null) { Debug.LogError($"Task failed with {task.Exception}"); } else if (task.Result != DependencyStatus.Available) { Debug.LogError($"Firebase dependencies not available with {task.Result}"); } else { Debug.Log("Everything's good!"); FirebaseAnalytics.SetAnalyticsCollectionEnabled(true); } }); You'll want some way to listen to these messages on device, and you can sometimes get the Unity Console to track those. But these days I like to install the Android Logcat [LINK] plugin. You can find i

Recommends Patrick Martin · 2020-08 · Stack Overflow · on “Using audio/images stored on Firebase cloud storage in my scene on Unity”

There are a number of ways to download a file from Cloud Storage. My recommendation would be to watch this video [this video] outlining integration with Unity if you're just getting started. You'll basically have three approaches though: Download a byte array [LINK] or stream [LINK] with the Unity SDK. This is probably preferred if you have space in-memory to hold it. // Download in memory, make the max size reasonable for your game reference.GetBytesAsync(long.MaxValue).ContinueWithOnMainThread((Task<byte[]> task) => { if (task.IsFaulted || task.IsCanceled) { Debug.Log(task.Exception.ToString()); // Uh-oh, an error occurred! } else { byte[] fileContents = task.Result; // this is needed for Unity

Cites Siddharth · 2020-04 · Stack Overflow · on “Firebase Initialisation Failed in Unity Editor”

For Firebase setup for my Unity game project, I was following this tutorial from first: Getting started with Firebase in Unity (2019) - Firecasts [this video] Within the video, there is a code to initialize a Firebase SDK: void Start() { FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(continuationAction: task => { FirebaseAnalytics.SetAnalyticsCollectionEnabled(true); }); } Now as I push the play button in Unity editor, on the spot I am getting this error dialog box: [LINK] After I press the cancel button multiple times on different dialog boxes, I was getting these errors in the console. [LINK] What I am doing wrong in this process that I can't able to understand! So please guide me to s

Cites Green Cell · 2020-10 · Stack Overflow · on “Unity accessing Firebase database causes Editor to crash”

I followed this video to setup my Unity project with Firebase: [this video] Everything is good at this point and I can also see my activity in the Analytics dashboard, so I'm fairly confident that my environment is setup ok. It all seems to fall apart when I try to access my database. I'll hit the play button and then the whole editor has a fatal crash. I have NO idea what's going on! Following simple examples to read from the database always results in a crash. Here's how I'm trying to access it so far: using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using UnityEngine; using UnityEngine.Events; using Firebase; using Firebase.Database; using Firebase.Unit

Cites ML_Follow · 2020-10 · Stack Overflow · on “Encountering two errors when building unity for android, firebase SDK”

I'm using unity 2019.1.13 and firebase 6.16.0. I tried adding firebase several times using [LINK] but with no success. Today I found your tutorial on youtube [this video] but still got the same results. removing `apply plugin: 'com.google.gms.google-services'` as you suggested gives me a lot of "duplicate class" errors between firebase analytics and google.gms Furthermore I can say that I'm not using EDM4U because it didn't help several times and added other dependency that I didn't want there.

Cites jonatan monsalve · 2020-10 · Stack Overflow · on “Unity Firebase is not initializing on builds”

This is the exact same problem presented in this question: Unity Firebase is not initializing on Android [LINK] But the solution to that one doesn't work for me because the code is different. When I run the app in Unity, Firebase is initialized correctly, but when I build the app, for Android or PC, it doesn't initialize. I write my code from this tutorial: [this video] using System; using System.Collections; using System.Collections.Generic; using Firebase; using Firebase.Analytics; using Firebase.Extensions; using UnityEngine; using UnityEngine.Events; public class FirebaseInit : MonoBehaviour { public UnityEvent OnFirebaseInitialized = new UnityEvent(); private void Start() { FirebaseApp.Check