[Firebase] How to Configure the Firebase Plugin

[Firebase] How to Configure the Firebase Plugin

  
Forge Component
(11)
Published on 2017-08-24 by Labs
11 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

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

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


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

Luiz Fernando Cruz wrote:

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?

Hello Luiz,

There are 2 specific connectors just for Firebase Cloud Message: one for mobile and one for the web.

Check them out and see if they solve your issue :)

Cheers,

Samuel Jesus

Samuel Jesus wrote:

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


Hi Samuel,

i got the firebase working for my chat in one mobile app and the chat is now interactive; 

I have another app where i want to get the same chat feature enabled with firebase. so i tried to use the same firebase configurations and chat is not working. So i created another project in firebase console and tried using these new configurations(ProjectID and Firebase secret) but no luck.

can you please help me with this.


thanks,

-Venkata

Venkata Rajam wrote:

Samuel Jesus wrote:

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


Hi Samuel,

i got the firebase working for my chat in one mobile app and the chat is now interactive; 

I have another app where i want to get the same chat feature enabled with firebase. so i tried to use the same firebase configurations and chat is not working. So i created another project in firebase console and tried using these new configurations(ProjectID and Firebase secret) but no luck.

can you please help me with this.


thanks,

-Venkata

The issue is now fixed. i forgot to set event on my chat component in the new environment. It is all good now. thank you for your support