0

I am new to Firebase. I want to send the push notification to the already existing android application from my Angular web application. Instead of using the postman or Firebase server I want to use my Angular application as a medium to send the alert.

I have created the Firebase account and generated the server key and sender ID.

I am not sure how to use it in my Angular web application

Please help me. Thank You.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Bharath T N
  • 11
  • 1
  • 6
  • Are you storing device tokens of your android application? or do you have topic subscription? You can try https://ravenapp.dev. You can configure your FCM keys in the dashboard and directly call raven api from your angular app to send a notification. Although you would need device token or a topic to make this work – proy31 Sep 02 '20 at 12:05

1 Answers1

0

Sending messages to a device requires that you call the Firebase Cloud Messaging API and specify the so-called FCM Server Key or authenticate or authenticate with service credentials. As their name implies, this keys/credentials should only be used on a trusted environment, such as your development machine, a server you control, or Cloud Functions.

They can't be used directly from your application code, without introducing a security risk. The reason for this is that having this key/credentials allows someone to send any message they want to all of your users.

Also see some of these previous questions on the topic:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807