[Firebase] How to Configure the Firebase Plugin

[Firebase] How to Configure the Firebase Plugin

Forge Component
Published on 2017-08-24 by Labs
10 votes
Published on 2017-08-24 by Labs

Create a FirebaseProjectId and a FirebaseSecret

1. Create two new site properties called FirebaseProjectId and FirebaseSecret.

2. Configure the Firebase credentials.
    a. Go to the Firebase console. You will need to log in with your Google credentials.
    b. Create a new project.
    c. Go to Project Settings > Service Accounts > Database Secrets, copy the Database Secret and set that value to the Component’s SiteProperty "FirebaseSecret".

    d. Copy the Project Id and set that value to the Component’s SiteProperty "FirebaseProjectId".

Adding References to the Firebase Plugin

1. In your Application Module, click the Manage Dependencies button.

2. Add references to Firebase > Server Actions > GenerateToken.

Generate a Firebase Token

1. In your application, go to the Logic tab and create a new server action to generate a Firebase token.

    a. Create a new server action with two output parameters: FirebaseToken and FirebaseProjectId. Rename this new server action to GetFirebaseData.

      b. Use the GenerateToken server action provided by the Firebase plugin, passing the Site.FirebaseSecret and the UserId in its parameters.

If you are going to use more than one component that uses Firebase plugin, you only need to generate token and ProjectId once. You can use the same configuration for all components.


c. Pass the FirebaseToken value provided from GenerateToken server action and Site.FirebaseProjectId to the output parameter.


  d. Use the GetFirebaseData action whenever you need the Firebase Token and ProjectId.

I do not know where to paste the information from 2c and 2d.  There are only 5 fields to past it in:  Name, Description, Data Type, Default Value, and Is Multi-tenant.

I have tried pasting the information into Default Value, but it states 'Default Value' must be set to a 'Text' literal value.  Pasting the information anywhere else does not work.

I found what I needed.  Module Management>Site Properties.

Nathaniel Elrod wrote:

I found what I needed.  Module Management>Site Properties.

note: FIRST PUBLISH. Only after that you can go to Module Management - Site Properties and see the FireBaseProjectID and FirebaseSecret

hello, how about use firebase in mobile?

Hi, I need to integrate my web application with Firebase Cloud Message, but after several tests I still can't make it work, do you have any tutorial on how to use it?

How do i get the project id? and do i have to match the Project name created in Firebase to the module/screen name created in Outsystems