Week 6 (Part3): Firebase to Unity

Nissie Bungbrakearti
code3100
Published in
3 min readApr 19, 2017

--

What is Firebase?

Firebase is a web and mobile app platform that allows people to develop and design their own high quality apps. It has many features such as analytics which calculate “user behaviour and measure attribution from a single dashboard”.

Firebase enables you to built the app you want and leave the operations to them which is more time efficient and helps create an app that is “bug-free”. It allows for robust authentication, a realtime database, hosting, cloud functions and more. They also aim to help you grow and engage with the users through notifications, dynamic links and invites etc.

Some apps that use Firebase include PicCollage, Shazam and SkyScanner.

It is our goal with the IoT group to find a way to send output data from arduino sensors/buttons etc up to Firebase and be able to bring that data in to Unity as a JSON file.

Although I have not been able to find much concrete documentation/forums on exactly what I need to bring Firebase > Unity, here is what I have found so far.

How to get Firebase to Unity for Android and iOS

One thing that is great about Firebase is its documentation for getting Firebase JSON data to Unity3D. However, the only plug in that has been made for Unity to receive Firebase data is for Andriod and iOS applications. Due to this not being what I needed I only briefly looked at the information to see if there was anything useful.

In order to add Firebase to any Unity project you must download the SDK which can be found here. Additionally, there are also a bunch of YouTube tutorials on how to create Firecasts from Firebase to Unity.

This brief tutorial looks at how to use the SDK to bring files from Firebase in to Unity. These are super useful if you are building an Android or iOS app, however using it for HoloLens apps would differ due to different C# scripts.

I would highly recommend looking at these tutorials in more depth if you are interested in adding Firebase to one of your Andriod or iOS Unity built apps and you want to utilise analytics or a realtime database. Please note that this requires Unity 5.3 or higher.

How to get Firebase to Unity

A plug in for Unity has been made to transfer data from Firebase to Unity, however it is not as well documented as the ones found on the Firebase website.

The plug in created by Dikra Prasetya can be found in the link above or from the asset store in your Unity project.

This github link explains how to use the plugin, however because I am still new to C# I don’t understand it completely and will have to try to and play with it. I will explore this plugin in another blog entry.

--

--