So you are probably wondering how do I use firebase realtime database?
I'm going to teach you how to set it up!
1. Firebase Account (Link)
2. Construct 2 (Account type doesn't matter)
3. C2 Firebase Api 3 Plugin by Rex (Get it here)
4. C2 Firebase ItemTable Plugin by Rex (Get it here)
How to set up the firebase account:
1. Go to the link provided above
You'll see something like this:
2. Press the "Go to Console" Button and login with your email account
You'll see a screen like this once you've gone through the setup:
Now click "add project" (NOTE: You can only make 5 projects with the free version)
Once you have chosen your name and filled in the form and hit enter you should see these 3 icons:
Now leave the browser as it is and import the Firebase Api 3 and Firebase ItemTable plugins into your C2 Project.
Now you need to go into the properties of the Api 3 Plugin it's going to ask you for the following stuff:
Go back to your firebase account and click the "Add firebase to your web app" button and wait a few seconds for it to fully load up.
You'll Get something like this:
Now paste the api key into the correct field in c2, authDomain into the correct field, Database URL into the correct field and also the storage bucket into the correct field.
You are almost done setting up the project file,
The last step is to open the properties for the ItemTable plugin and remove the "items" text from the sub-domain field and leave it empty, this disables creating a new sub directory for the realtime db which affects reading the data back from the db.
Congratulations You've now set up your database and the project file for using Firebase Realtime Database! In the next part of this tutorial I'll be going over how to read and write to a database, if you want to learn this then carry on reading but if you already know how to do this then you can stop! :)