waleed ragab
waleed ragab

Reputation: 31

How to use firebase realtime notification in laravel?

I want a notification to be shown when any user posts any new message in my Android app, my iOS app, and the Web the notification should be shown to all the users who are using the app, with the message in the notification like WhatsApp notification. I am using a firebase real-time database for saving and retrieving the message.

Please let me know how I can achieve it.

Upvotes: 2

Views: 3073

Answers (2)

waleed ragab
waleed ragab

Reputation: 31

First step is to get the firebase messaging sdk & credentials from firebase console. Second using Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).

https://github.com/apility/Laravel-FCM

Upvotes: 1

Rehan
Rehan

Reputation: 4013

First step is to get the firebase messaging sdk & credentials from firebase console.

Using that sdk, we need to get permission from user to send notification.

If the user accepts, then we get a token.

Using the acquired token, we can send notification to the user with the credentials retrieved from the firebase console.

You can see full technical blog on medium here

Upvotes: 1

Related Questions