Unity User Data & Scoreboard Tutorial - Firebase Realtime Database. Hello guys, this is a tutorial on how to save and load user data in unity using the Fireb. Now the good news. We are deleting this repo because Unity is becoming an officially supported platform in Firebase and has gone into public Beta! Check out the documentation at our official firebase site and watch our presentations at the Firebase Dev Summit.
Google Firebase Unity Admob Plugin provides a way to integrate firebase admob ads in Unity3D Game and u3d app. You can use it for Unity iOS and Android App with the same c# or js code.It support all native firebase admob features such as Native Express Ad. Google Service Unity Plugin is a Unity Plugin For Google Service.Include Google Admob. Firebase provides detailed documentation and cross-platform SDKs to help you build and ship apps on Android, iOS, the web, C, and Unity. I've installed a proverbial shitload of stuff, and a lot of it weird stuff, but getting Firebase up and running with iOS is and Unity up there among the all-stars. I'm using Firebase Auth and Analytics modules. It 'should' be simple! I had a sample app with Apple Sign-in that kind-of worked in the XCode Simulator: signs in; but no analytics are.
Sophos xg web protection. If you are building a Unity application that will require user sign-on, Google’s Firebase is a great option, with Authentication, Database, Storage, Hosting, Functions, and more. Plus it’s fairly easy to get set up! In this tutorial, I’ll explain how to create a Firebase account, register your app, and get your Unity project prepared for Firebase integration.
Note: this tutorial assumes you already have some familiarity with Unity. If you are new to Unity, I highly recommend the official getting started tutorials. If you are new to deploying Unity to mobile platforms, follow this building for mobile tutorial, which has all the information you need to get started.
Firebase Unity Sdk
This is the first post in a series about connecting Firebase to Unity and utilizing Firebase Authentication and Database services. See the bottom of this post for the full list.
What is Firebase?
Google’s Firebase is a BaaS (Backend-as-a-Service) that allows you to create web and mobile apps without server-side programming, making development easier and faster. This single platform provides authentication, storage, hosting, functions, machine learning, analytics, and testing infrastructure. These services are all bundled together into a Firebase project.
A project is a container that supports the sharing of resources between cross-platform apps. A single project can support up to 30 apps, and you can use multiple projects to support multiple environments, such as development, staging, and production.
Creating a Firebase Project
Navigate to Firebase and select the Get Started button. Sign in with the Google account that you want to be associated with your Firebase account. When that’s finished, you will be taken to the Firebase console. This is your home base, where you can view all the Firebase projects you have created.
Select Create a Project and give your project a name such as: “My Unity App.” You will notice that right below the project name is a unique identifier such as my-unity-app-30bed
. That identifier is what will be used for your database URL, hosting subdomains, and more. The identifier cannot be changed once it is created, so be sure you are happy with it.
Next, you will be asked about adding Google Analytics to your Firebase project. Google Analytics can be useful if you are looking for in-depth reporting on your app. It can provide useful crash reports and user insights. This is not necessary for what we are doing in this tutorial, so feel free to choose whichever option is best for your project.
Once you complete the initial set up, Firebase will create your project and provision resources. Your console should now look somewhat similar to the screenshot below. By default, you will have the Spark pricing plan. This plan is free and will have everything we need to set up authentication and users in a database. To read more about what the Spark plan offers, view the full plan details.
Registering Your Unity App with Firebase
In the console, select the Unity icon to get started with adding Firebase to your project. You can register both iOS and Android apps, but to do so, you’ll have to provide an iOS bundle ID/Android package name. To find that information, open up your existing Unity project. Click on File > Build Settings.
Android
For Android builds, select Android on the Build Settings menu and then click on Player Settings on the lower left-hand side. Here, you will see an accordion menu of Android Settings. Look for Other Settings and then Package Name. This identifier is needed to associate your app with Firebase. Change the name to something unique. It should follow the pattern: com.CompanyName.AppName
.
iOS
For iOS builds, select iOS on the Build Settings menu and then click on Player Settings on the lower left-hand side. Under the accordion menu of iOS Settings, look for Other Settings and then Bundle Identifier. This identifier is needed to associate your app with Firebase. Change the name to something unique. It should follow the pattern: com.CompanyName.AppName
. This does not have to match your Android package name. Top compact crossover suv 2020.
Now you can copy and paste your unique Android and/or iOS identifiers in the Firebase App registration form. Note that these values must always be the same! If you ever change the identifier on Unity, be sure to change it with the setup wizard on the Firebase console.
Firebase Unity Documentation
With the first part of the form completed, go ahead and register the app.
Next, you will need to download the google-services.json
for Android and the GoogleService-Info.plist
for iOS. These files need to sit somewhere in your Assets directory in Unity. Their sole purpose is to tell your app how to connect to Firebase.
Next, a link to download the Firebase Unity SDK will be provided. This zipped file contains packages for both .Net 3 and .Net 4. If you are using Unity version 2017 or higher, you will need the .Net 4 packages. Open your Unity project and navigate to Assets > Import Package > Custom Package. From the unzipped SDK folder, navigate to your specified .NET version and select FirebaseAuth.unitypackage
, FirebaseDatabase.unitypackage
, and if you chose to use Google Analytics, import the FirebaseAnalytics.unitypackage
also.
Click “next” on the Firebase setup page and then continue to the console. On your console, you should now see that your app is registered! In my case, I have two registered apps: one for iOS and one for Android.
What’s Next?
Next time, I’ll show you how to set up Firebase Authentication so users of your Unity app can sign in with an e-mail and password or create a new account.
This is the first part of a series on setting up Firebase with Unity:
Firebase Unity Sdk
- Storing User Save Data with Firebase Database (coming soon)