I'm building a chat & notifications server based on NestJS & I'm worried about the best method to build the server to handle a minimum of 10K users/month. Please I need help. ( It's a react-native app client ).
I intend to use FCM & APNS to push notifications to users but about chat, no idea what to do.
Related
I just finished the Google codelabs about Push notifications and I have some questions that I couldn't find any answer yet.
Using only web-push library on the server (so no Firebase or anything), do we need to create a database in order to store the endpoint and the userId ?
What happens if the client is offline when the server sends a Push notification ? Does the client will get it as soon as he's online ? Is the notification lost ?
-> if the notification is lost would it be a good solution to create a database table containing each notification and the status (delivered, not delivered) for example ?
I even searched in the on the Push API documentation and on the web-push npm page but there aren't any informations about those points.
I am following this tutorial https://www.twilio.com/docs/chat to integrate simple chat into my ASP.NET Core application. I don't understand where are messages from chat stored. Are they stored on Twilio server or I should manually store messages on my backend?
I have found two repositories with relevant code:
https://github.com/TwilioDevEd/sdk-starter-csharp - when I start chat with this project, clients are able to chat, but new client is not able to see old messages
https://github.com/TwilioDevEd/twiliochat-csharp - this code can start, but it is not possible to send messages with error code
WebSocket connection to 'wss://tsock.twilio.com/v2/wsconnect?token=eyJj...' failed: Error during WebSocket handshake: Unexpected response code: 503
Chat history is maintained unless you delete it. You can view chat history by joining an existing Twilio Programmable Chat channel which was used before.
You can also view the Chat history using the respective API's.
Read multiple Message resources
I need to implement push notification to our Android App using Xamarin. Here is the process. We have web version which used by the Manager. The Manager creates and assign job to the driver. The App version is used by the Driver where it shows the list of jobs and processes of job until its complete. So, when the Manager assigned the Job to the Driver in the Web version, it will then notified to the Driver in the App version that "new job is assigned". Basically, both the web and app uses same database then we created an api(REST API in MVC C#) to connect and get data from the db to be used in the mobile app.
Can someone recommend to me which Push notification plugin(a plugin or nuget) should I use to do this? Currently, I have set up Push Notifications through App center & Firebase but not sure how this work.
Thank you.
I need to implement push notification to our Android App using Xamarin.
I would suggest you use Firebase for mobile push notifications for Android as it is a product by Google, and was made for mobile applications. For push notifications, you will be using Firebase Cloud Messaging also known as FCM. See to it that you are well versed on how it works before you start coding anything read the documents it answers most of your questions there itself.
The Manager creates and assign job to the driver. The App version is used by the Driver where it shows the list of jobs and processes of a job until its complete. So, when the Manager assigned the Job to the Driver in the Web version, it will then notified to the Driver in the App version that "new job is assigned". Basically, both the web and app use the same database then we created an API(REST API in MVC C#) to connect and get data from the DB to be used in the mobile app.
For this, you will have to check on how to work with Firebase using Rest-API. Once you configure the Rest-API and then apply your business logic to it things will be quite easier than you might have imagined.
Can someone recommend to me which Push notification plugin(a plugin or NuGet) should I use to do this?
My recommendation is quite simple, Do not use any sort of a firebase push notifications plugin!. I have had a very bad past with plugins and ever since then I never recommend fellow developers to use plugins until it is a well-maintained one. I would rather ask you to simply configure Firebase on the basis of the guides that are available online. Like the following Xamarin.Android guide for FCM. It is detailed contains everything that you are looking for and what else I would suggest is you check firebase related answers on SO and you will find that almost everything that is not available in docs is covered around here and in detail. Like the following:
How to handle Firebase Notification i.e. Notification Messages and Data Messages
Push Notification in android with firebase get token
How to send device to device messages using Firebase Cloud Messaging?
Receive push notifications on one android app from two Firebase projects
We have social networking website which has a messenger module ( Chat with friends ) which is implemented in JQUERY, PHP and HTML with mysql. Now we are creating Mobile app of this Messenger module. So we decided to go to Ionic framework.
Now my problem is As we did R&D, We need to use GCM or FCM for smooth running of messenger with background service for real time chat and for push notification.
So my query is, If we use GCM or FCM, And one user has app and another user on website,
Then how they can communicate via GCM or FCM?
Another approach is we don't use GCM or FCM, Create REST API on server for Messenger app and call that API in background for messenger.
So which one is good approach?
If we use REST API then can you please share any example of this type, We are not able to find on google.
Please share your thoughts, We are struggling from last 7 days on this.
You will need to use websockets
on the client side socket.IO is a godd library ) , you need to connect to a socket server ( in php Rachet is a good one ) once the connection is open , you will basically have an exposed client side method ( function ) that the server can directly trigger.
eg: you have a chat window : two people connect
1) person A sends a message to the server
2) The server receives this new messages, the triggers a broadcast to the socket server
3) The broadcast calls newMessage( messageText ) on the client ( Person B )
4) All the connected clients then display the new message
you can also have private channels ( for chat rooms )
This is a VERY high level description of my understanding of web sockets ( you should go and do some more research on websockets, but this is a starting point )
I am building a tvOS app for the new Apple TV that needs to get notifications from a server every time that a chat message is sent. This notification is also to be displayed on the Apple TV. As much as I understand push notifications are not allowed with tvOS.
With this being said, are there any alternatives to what I need?
To clarify: This is a chat app that needs to display a notification to the user on the TV screen every time a message is received by the user. The app stays running indefinitely, while showing instant notifications. - I cannot use push notifications.
Please let me know if this makes sense, and thank you in advance for your help!
We recently built an app for apple TV that shows instant messages from different clients connected to our server. A good library that will answer your requirements is socket.io-client
Just google socket.io and learn how it works. Basically, you wait for a connection on your server and then you can send messages to your clients. On the client side (tvOS in your case) you specify what methods to run as response to the different event coming from the server.
Good luck.