Sending web push notifications from Laravel - laravel

I have a website running Laravel in the back-end, where users can create reports for other users.
When the report is created I would like to send a push notification to recipient user's desktop.
Do I need to use services like Pusher, OneSignal?
Any useful site with examples would be appreciated.

Your question
You could use Pusher, Redis/Socket.io, Pubnub, etc. Which one to use? well, this is more an opinion-based question.
These services broadcast events, then in your client apps (like your web front-end) you configure the client-side libraries of the service you choose to subscribe (to channels) and listen to those events. The documentation explains it better.
Examples/tutorials
Pusher
This is a tutorial published by the Pusher team.
Redis/Socket.io
This one
is a Laracasts series about this.
Just google.
Update
There is a Laravel-specific alternative, a package created exclusively for Laravel:
Laravel WebSockets
This is the post talking about the package and its inner working.
This is the repo.
Here you have the documentation.

If you like to show Native Desktop notification then i would suggest Web Push notification. In this way once user subscribed to push notification ,they will get real time notification and does not need to be on your website.
https://github.com/laravel-notification-channels/webpush

Related

How to notify user via telegram in spring boot app&

I have spring boot app which able to notify users via their emails about some events. In mentioned case app is using user email. I need same functionality for telegram - by user nickname or phone number my app have to notify user about event.
How to implement sush simple case?
I have already worked on a very large scale project. One of the requirements was to send notifications through various channels, including Telegram Messenger.
You can choose different ways to do this, The solution I can suggest to you is to use the APIs that Telegram itself has to communicate with the core.
I guarantee you that many of your needs will be met through these APIs.
I will share the link that helped me a lot before, I hope I could have helped you.
https://core.telegram.org/api
https://core.telegram.org/api/obtaining_api_id

What is the technolpgy, does Facebook/Youtube Notification Systems use?

I am currently working on an web application, which need to implement a notification system, just like Facebook and Youtube does. (Not mobile PUSH Notification. Just to show how many notifications are in the notification couter and, when soneone expand it, show all notifications. Just as Facebook) What I need to know is, what is the following best method to use.
1.Websocket
2.SSE
3 XMPP
Our application is on budget and, we are running it on a VPS server.

Can we replace Pusher with Google cloud messaging for push notification in laravel?

We are developing an app using Laravel 8.3 for back-end, our boss is forcing as to keep all of our (3dr pray services) as less as possible, so most of the services that we need can be provided by Google & firebase.
we have a real-time chat inside the app.
Now the question:
Can we replace Pusher with Google cloud messaging for push notification?
will the (online/offline) and (seen/read) be as good as pusher?
if yes, what driver to use inside the .env file?
Thank you

How make real time notification laravel with firebase?

I created laravel web about hospital i want to notified the user when the doctor upload file treatment i don't want use the pusher because expensive for me now ..so any way to do with firebase it's better if now video or article showing me step by step AND how connect the icon when upload the user get notification
You can use the Notifications in Laravel, here is the documentation for the details: https://laravel.com/docs/7.x/notifications
I'm not sure what notification channel would you like to use, Firebase Cloud Messaging is not supported by default, but there is a 3rd party package for that: https://github.com/laravel-notification-channels/fcm
You can find a lot of custom notification channels here: https://laravel-notification-channels.com/

Play & App Store Webhooks / Server Side Code on subscription start and cancel

I need to add server side logic when a user buys and cancels a subscription. To me this seems like a basic feature that many apps probably use. However as it turns out it's not that simple to setup up the need webhooks.
My App will be available on android and iOS, so I will need to configure both, which is why I thought about using RevenueCat. But it turns out, this is a paid feature for $110/month, which is way too much for a/my new app. This is probably the biggest time saver for RevenueCat compared to using the official InApp Purchases packages, so I don't see why they would make it a paid feature.
Anyways what the best way to handle webhooks with the Play Store and the App Store? Any Guides and Tipps would be very helpful!
Apple and Google both offer server-to-server notifications that will notify you when a subscriber cancels.
Apple guide: Enabling Server-to-Server Notifications
Google guide: Real-time developer notifications
If you have your own user Ids, they won't be present in these server notifications so on your server you can save the user Id along with the transaction identifier of their original purchase. That way when a notification comes in you can look up the user from the transaction identifier and flag them as cancelled.
Alternatively, the RevenueCat API is included on their free plan so you can periodically poll their GET /subscribers endpoint to get the latest subscription status for a user. This obviously won't be real-time, but may be enough for your use-case.
Update: I decided to solve this issue similar as #enc_life suggested with the RevenueCat API. For validation the purchase, I send a request to my server, that checks with if the user actually bought the subscription. For canceling the subscription, I execute a function everyday on my server, that checks for all subscribers if the subscription is still valid.

Resources