4367
Views
27
Comments
[Firebase] How to Configure the Firebase Plugin
Question
Forge component by Labs
11
Published on 02 Oct 2019

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.

Rank: #53442

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.

Rank: #53442

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

Rank: #48093

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?

Rank: #6568

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

I've got the same problem, in AppMobile don't work.

Rank: #6568

Hi Team

Please help me configure firebase for mobile app. 

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


Staff
Rank: #193

Hello Venkata,

The name if your project can be whatever you want, and it there is no need to be equal to your OutSystems module. The connection between OutSystems and Firebase is done using the project ID and not the name.

To get the ProjectID, on the Firebase console, go to Project settings, and in the first tab (General), you will find that information:


Cheers,

Samuel Jesus

Rank: #204

Hi Basha.

Go to <your environment url>/ServiceCenter
Login and find your application under the Factory menu, Application list.


Clicking the name of your application will lead you to its detail page.

Find the Module where you are using the Firebase component and click the name.

In this case, I'm using In-App Chat Web app as an example.

I'm using the In-App Chat Web component in the Sample, so I'll be setting the values there.


Go to the Site Properties tab and select the property you want to set.

Paste your ProjectId in the textarea and click Apply.

Do the same for the Secret and your Firebase component should be working.

Hope this helps.

Cheers

Rank: #204

Hi Basha.

Firebase changed its process in creating a database for the project. You now have two options:

Locked Mode and Test Mode.
In Locked Mode, the database cannot be updated, and so, the receiver is not notified on the changes.

Please try the settings for the Test Mode, by changing your database rules to the following:

{
   "rules":  {
       ".read" : true,
       ".write" : true
   }
}


Hope this helps.

Cheers

Rank: #2715

Everything was great until the

Generate a Firebase Token 1c and 1d part. Does anybody have a working demo on how to apply this?

Rank: #396

It looks like rules below are not secure. Does anyone have any recommendations? 

Rank: #722

I try to configure the firebase component for web. I have already succeeded in the past but now I constantly get a 401 unauthorized error. I configured everything like the first post. 


Thnx in advance!

Rank: #101

Hello!


Currently the component is using the deprecated way. (database secret)
Are we going to see an updated version any time soon of the component which is not using the deprecated way?

Greetings,
Niels F.

mvp_badge
MVP
Rank: #490

Hey all,


Is this still working for mobile? I used this in the past and was working but now I don't get this working anymore.

I do get the messages sent to the Firebase Database but on the mobile I don't get any event triggered.


Best regards

Rank: #42078

Hi, I saw this video and I follow all the steps and did not worked, anybody else had problem?

https://www.youtube.com/watch?v=ygbu3AITS4k

Rank: #0

Those who are still getting a 401 error in-spite of doing all the steps correctly, please ensure you selected "Realtime Database" as the database.