Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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. 

View solution in original post

2 Replies

Avatar

Community Advisor

@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 

Avatar

Correct answer by
Community Advisor

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.