YII2 push notification in a browser - php

I have to implement notification to users when the news on a site is added.
I have done this via email and now I have to do this notification in a browser. I guess, I should implement a push notification.
How can I add a push or any other suitable notifications in a browser ?

Related

what is the proper way to save a firebase push notifications sent

I'm using firebase push notifications php api with android...
When I send a notification from firebase API, to android device, I also make a MySQL input, to register one copy of that, and work!
but...
What happen when the API sends too many push notifications?
There is no problem with my shared server?
I'm worried that my server will collapse for too many records for each push.
Right now It work like this...
Firebase API PHP send notification -> MySQL register that notification in one table -> Android Device recieve the notification.
but I don't think this is the right way...
so... the question is...
what is the proper way to save a firebase push notifications sent...?

One Signal Web Push Notification Custom Message PHP

I am looking for a way to send custom push notification. I have already have a One Signal account and it works on my website. Now, I need to send push notification when someone creates a message to users. I have email notifications which work. How can I create custom push notification through php?
Thanks

Send push notification to APP without device token or register id

I have already experienced to send push notifications to android and apple device with specific device token or registered id and I did use it in different projects, but this time I am just looking for a solution where I can send a push notification to APP means whoever installed the APP will get a notification.
Please let me know if this is possible and if yes then how.
Thanks
You need push tokens to send notification and there is no option to send push message to all devices without knowing their token . But you can send topic notifications if user has subscribed to that specific topic . You may need topic subscription to send push message to all subscribed users .
Client side you can subscribe to topic like
FirebaseMessaging.getInstance().subscribeToTopic("TestTopic");
find it here

Notification from web site (HTML Table) to Android application in real time without using GCM

I am developing an android application and website as well, in this i want to send notification in real time from Admin panel to specific android application user. The main problem is that using GCM (Firebase CM) there is a token generated from android application and stored it in the database, using this token we can send message from admin panel to android application user. Is there is way that we can receive/send notification without using "token" because e.g. "Teacher send notification to students from Website to Student android application teacher just select the registration name or section and just type what he want to send and click send button. Notification should receive to that particular user.
How we can do it? Can any body help me?
Use Android service and call API as a background and check new entry in notification table, if found new entry display it as a notification
Without Device Token you can not send any notification from Admin Panel to Android App. To send notification FCM needs a unique ID that is Device Token.
To resolve your query:
You can use Alarm Manager or a Background Service that will call your API to check have any new message of teacher in your DB, if have any new message then generate a notification with that message.
Only Background Service is not a complete solution, it will only call your check new message API.
Your Alarm Manager that will trigger at any given time duration e.g. 30 sec and call your Background service.
That can help you without token.

How to trigger iOS push notification for individual users using webhook

I have written a web app in PHP which is an MVP for a product I am launching. Uptake is good and I have active users.
I notify users of certain events right now by integrating with Twilio and sending them an SMS when activity happens on their account.
I would like to release an iOS companion app so that I could notify them via native push message as Twilio SMS costs are decreasing the viability of my product and I do not want increase the monthly price.
I have researched various third party tools such as Pusher, Pushover and Onesignal but none of them seem to fit my need, as far as I can tell.
How could I trigger a custom push notification to an iOS user using my iOS companion app? Ideally I would swap out the Twilio api call and insert something else that called the push message.

Categories