I am working on a VOIP calling app based on WebRTC. For the signalling I'm using websocket which is implemented on a background service. But most of the case the service get killed by the OS, so I implemented Firebase Cloud messaging (FCM) to send the Call offer notification which works on most of the device. But it has delay and chinese variant phone doesn't get FCM notification if it is removed from the recent app list. But I have tested WhatsApp on all of these phone and it can able to send call notification almost 100% of the time on any android device. So how whatsapp managed to send and receive those signalling call offer notifications in every case.
Related
I'm trying to build a real time chat app.
I have integrated https://pub.dev/packages/flutter_local_notifications package for push notifications and this works.
I am NOT using Firebase, i am using my own custom backend that uses https://socket.io/ for real time chatting.
I want to receive a push notification when the user sends a chat message. Push notifications work when the app is in foreground or background. However when i terminate my app from the process (app is killed), the push notifications no longer work.
Is there a way to send push notifications without using Firebase so that i can receive notifications even when my app has been terminated from the process? I need this to work both for android and ios.
Basically, I don't recommend any solution for push notifications instead of firebase.
But if you have your reasons to use socket in this case I suggest you take a look into this package how it uses background service and tries to implement your own way to setup socket-based notification background service.
https://pub.dev/packages/background_locator
How does the Facebook messenger establish video calls when app is in background?
I'm making an android video call hybrid app using webrtc and socket.io, the video calls works fine with app open but I don't know the best way to contact a target user if he's not in the app, my idea is to send a push notification to wake up mobile and enter in the app and then start the video call, the problem is if target user don't allow notifications.
I've already tested calls in messenger with notifications disabled and with the app in background and the call works the same. I can't find any explanation how messenger can start a call when the device is not awake.
Is a notification or a service that allows that?
Check out Firebase Cloud Messaging, it's what most people and what Google recommends to use to push notifications. However, that doesn't mean it has to be used to send notifications and it won't be blocked even if notification is disabled. You are able to send data payloads with FCM and handle them on your client with onMessageReceived with FirebaseMessagingService. For more details, refer to the documentation.
I am currently aiming to make an app in Android Studio that allows one user to push a button and another user to receive a push notification as a result. How might I do this?
You're going to need a server to act as an intermediary. Set up an API endpoint that your app can call to request a notification, and have your server dispatch a message to the receiving device using something like FCM.
I want my app to receive WhatsApp messages, check the content (I'm planning to do some deep learning methods using the message content) and then push the notification and deside if to silence it or not.
Basically I'm building an application that silence non-urgent WhatsApp messages (using machine learning to deside whether it's urgent or not).
How can I receive WhatsApp messages to my app and mute some of them?
You can’t handle notifications of another application because their server sends a notification that only their application can handle.
This is how FCM works: Firebase Cloud Messaging.
ok so I have an app in react native which retrieves the information from an api. Now the api whenever it has data to send will send the data to the device and I want my app to be always running in background so as to receive the response from the api. API can send data anytime so I want to show the user data received as soon as a message arrives.
You need to look into Push Notifications. You can't guarantee that your app will always be running in the background, but Push Notifications allow you to send data to a user's phone even when the app isn't running. Once the user opens the notification you can perform some action, based on the data sent with the notification.
A good React Native component for push notifications is React Native Push Notification, which offers cross-platform notifications. Once you have this implemented you can create a handler which calls your API when the app is opened from a notification.