I need to use firebase cloud messaging application in web application development. I am able to send the push notification to a single client from the server. But I dont know how to subscribe tokens, i.e, sending push notifications to multiple clients from a single server. Is there any example code available for sending messages/notifications to multiple clients?
Related
I am implementing a very small wpa. in this application, I need to initiate some messages to the client via the server.
I have checked the information about web push notification and technically it is possible to implement it.
But according to my understanding, I need a Push Service to act as a bridge between my App Server and web browser. Different browsers use different Push Service, for example, Chrome uses FCM, Firefox uses its own, and Safari uses Apple's.
So if I need to send this Push message, I must target the user in different browsers, and then App Server sends it to different Push Service Server?
Or furthermore, even if I can send a push message to FCM, Firefox and Apple's Push Service Server now, but the user opens it with Edge, I can't send it to him now?
Is it possible to deploy a Push Service Server by myself?
I am running a cloud scheduler with firebase functions and would like to send the specific user a notification when something in the cloud using node js has completed, I researched about cloud messaging but it send it to everyone, I don't want that, how can I achieve what I'm looking for
You can send notifications to a specific app instance by targeting the FCM device registration tokens.
https://firebase.google.com/docs/cloud-messaging/send-message#send-messages-to-specific-devices
I have two Ionic applications, and both use the same API served with node. What I need is that when one app sends a post request, the other app gets that post request and uses the information that comes from the request. How can I achieve this? I thought of listening for that particular post request, but I don't know if that's possible, or when the post request reaches the API, trigger some action in the server that sends the information to the other app. Is this possible?
You can use Firebase Cloud Messaging to implement this.
When one ionic application requests a service from your server by using HTTP Requests, the server will trigger the respective action and sends a push notification to your other app by using the Firebase cloud messaging service. Your 2nd app will capture this push notification by subscribing to a URL in Firebase.
For the server-side, You can use fcm-node module or Firebase NodeJS Module to implement this functionality. For the mobile app, you can use providers in ionic to subscribe to firebase cloud messages
A detailed guide on implementing push notifications can be found here
I am developing an hybrid mobile app that collects some user info in background while the user is calling (just during a phone call). Then I have an admin dashboard on a website, where the admins can monitor the (almost) real-time status of the mobile users. To do this, my mobile app must send info to the server. Right now I just use:
setInterval(sendData, 5000) to send data each 5sec from the mobile app to the server.
setInterval(refreshData, 5000) to request the current status from the admin dashboard to the server.
I don't need a "strong real-time", so it's enough update each 5secs.
Anyway I'd like to know if it's better use web sockets among the mobile app and the server, since the app should send data very often during the day.
Thank you
Servicestack is awesome. I'm using it for my Xamarin projects (monotouch and monodroid).
Users login and authorised by ServiceStack. The session details are kept in memory i.e. userId, Ipaddress, etc.
But what would be the best way to add websocket functionality so I could push notifications to these users?
Or would it be better to just leave a regular websocket open on the client and have a small websocket server somehow read the session data (user Ipaddress) from ServiceStack in order to relay bespoke messages to client?
As an alternative to Web Sockets ServiceStack supports Server Sent Events for real-time event notifications. All the Chat Apps in the Live Demos utilizes Server Events for its real-time communication.
But it doesn't include any support for Web Sockets itself, although here's an example of using ServiceStack and SignalR in the same project.