Firebase Setup

This documentation is for the WIP feature https://github.com/4ian/GDevelop/pull/1694. It isn't present in GDevelop yet.

Firebase is not a direct feature but an integration, meaning you have to connect it to the real service to use it. Here are the instructions to do so:

Step 1: Set Up Firebase

First, go on https://console.firebase.google.com/. You should have your project list. Let's create a new one: Firebase Setup Then name your project however you want. I'm going to call it Tutorial-GDevelop for this guide. step (1/3)

You can then enable or not Analytics. I'm going to enable them as I want to showcase every feature, but it's up to you if you do or not. You can always change that later.

Create the project step (2/3)

Configure Google analytics step (3/3)

You should now have a firebase dashboard.

Step 2: Add app to GDevelop

GDevelop registers itself as a web app, so you need to create a new web app. To do so, click here: Type any name you want again and untick “Set-Up firebase Hosting”.

At the time of writing there is no need for firebase Hosting but support for it may be added to GDevelop later.

You should now have Some code displayed to you, like this: You only need the firebase configuration. Copy paste the part between the {} including the {}. For me what I need to copy is:

  {
      apiKey: "AIzaSyCbFhG_bCyAvnxlmVSgIgn7Em0XOYE9YXA",
      authDomain: "tutorial-gdevelop.firebaseapp.com",
      databaseURL: "https://tutorial-gdevelop.firebaseio.com",
      projectId: "tutorial-gdevelop",
      storageBucket: "tutorial-gdevelop.appspot.com",
      messagingSenderId: "386980638073",
      appId: "1:386980638073:web:b00afc0ecb3ed7ca4f53a8",
      measurementId: "G-R0KBN0HPQ8"
  }

Now open the GDevelop project you want to integrate Firebase to, and go in the project properties. In the “Firebase Configuration” Field, paste the configuration you copied. You will notice that there is an error message saying this is invalid JSON: It's normal, because the format used by GDevelop is tiny bit different of the one of firebase. You need to wrap all texts with a “”. My configuration for example would become:

  {
      "apiKey": "AIzaSyCbFhG_bCyAvnxlmVSgIgn7Em0XOYE9YXA",
      "authDomain": "tutorial-gdevelop.firebaseapp.com",
      "databaseURL": "https://tutorial-gdevelop.firebaseio.com",
      "projectId": "tutorial-gdevelop",
      "storageBucket": "tutorial-gdevelop.appspot.com",
      "messagingSenderId": "386980638073",
      "appId": "1:386980638073:web:b00afc0ecb3ed7ca4f53a8",
      "measurementId": "G-R0KBN0HPQ8"
  }

Now there shouldn't be any error: Congrats! You can now use the Firebase extension!

Arthur Pacaud 2020/05/06 14:21