Invoking firebase push messaging API upon submission of form component on AEM webpage.

Avatar

Avatar

kushal_srivastava

Avatar

kushal_srivastava

kushal_srivastava

03-03-2021

Hi everyone,

 

I have a HTML form component on my page (not by AEM form) , I want to invoke a firebase push messaging API upon submission of that form via a Servlet.

what would be the best approach for this and if there is any material regarding this.

 

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Vijayalakshmi_S

MVP

Avatar

Vijayalakshmi_S

MVP

Vijayalakshmi_S
MVP

03-03-2021

Hi @kushal_srivastava,

When we want to include as part of AEM project : 

  • Firebase Admin Java SDK is available in maven central - Make use of this dependency and we are good to write desired functionality in Servlet. 
  • We need to make sure the dependency is available as OSGi dependency when deployed in AEM instance for it to resolve. 

High level steps for implementation:

  1. Firebase project and service account set up
  2. Make use of SDK in project and initialize by authenticating using service credentials created above
  3. Make use of desired functionality from the SDK - In this case, it is to send messages. 

Docs related to this for reference:

Please check and let know if you are looking for any specific information. 

Answers (1)

Answers (1)

Avatar

Avatar

Umesh_Thakur

MVP

Avatar

Umesh_Thakur

MVP

Umesh_Thakur
MVP

03-03-2021

@kushal_srivastava ,

I think approach should be totally based on your requirement. if there is not sensitive data you gona submit then take help from ajax or vanila js or if you are using any js framework then you can use that as well. but if you are accepting any secure info or data then you can take help from Sling model or Sling Servlet for this purpose but again performance of the site should also be considered because submitting  or consuming api from the backend is expensive on performance front.

I think those are some point should be taken care before taking decisions.

Hope this will help.

Umesh Thakur