Implementation of WhatsApp/Telegram like calling feature in Flutter - flutter

How can I implement WhatsApp/Telegram like call notification when the flutter app is in the background or cleared from the recent task (clearing ram)? Can anyone let me know Exactly How to do this?

There is a great youtube series on this exact topic. In the series, a YouTuber by the name of the CS Guy creates a clone of Skype. I've placed the link to the video where he explains how to create a pop-up screen when a user calls another user, however, you may need to watch the previous videos within the series in order to get everything working. Its quite long but I recommend you watch the entire thing. In terms of displaying notifications when a user is called, I recommend you watch a video by Fireship listed below. In the video, he explains how to send notifications in the background when a certain event occurs in Firestore.
I can't explain the entire process in detail to achieve what you want but I can give a general overview of what you would need to do.
Watch the video/entire series by the CS Guy and complete everything
Learn how to send push notifications in firebase from Fireship
When a new document is created within the calls collection (You will understand once you finish the cs guy series) trigger cloud function.
Find the uid of the receiver of the call within the cloud function and grab the user's token from Firestore.
Finally, send a notification to the receiver telling them about the incoming call.
CS Guy:
https://youtu.be/v9ngriCV0J0
Fireship: https://youtu.be/2TSm2YGBT1s
I have done the exact same thing in my application and can help you out if you need further assistance, however, please go through both videos/series first.

You can use the flutter_local_notifications plugin with the firebase_messaging plugin.
From the documentation of the flutter_local_notifications plugin;
[Android] Support for the following notification styles
Big picture
Big text
Inbox
Messaging
From the documentation of the firebase_messaging plugin;
With this plugin, your Flutter app can receive and process push notifications as well as data messages on Android and iOS.

Related

How to setup notifications in flutter application?

I was wondering if Flutter has the ability to generate push notifications from within the app. If so is there a code example of this?
Description:
An event occurs on the flutter app such as a button being clicked or an if statement being triggered, I want a push notification sent to the user.
The app should also always be running in the background, is this possible? If so can you provide me a link with an example of this implementation.
Thanks in advance for all the help!
I have looked on google but I haven't been able to find a lot of information regarding these two topics.
Being an iOS engineer, I'd say that you actually want local notifications. Push notifications are usually being sent by a server.
You could check how it's usually done on iOS natively: developer.apple.com.

Incoming call notification

We are developing an app with angular/ionic in which we use capacitor jitsi plugin for video calls. What we are now trying to do is to receive notifications (via firebase) like in whatsapp with the incoming call screen and two buttons to accept and decline. Any idea on how to do that?
Thanks
If you got the choice to change the notification service, instead or directly using firebase, you could use Onesignal which extends firebase and they already have a service named VOIP notifications which should kinda do your needs and here is the link:
https://documentation.onesignal.com/docs/voip-notifications
In case your are restricted with firebase or need to know how this could be done, bellow will be the way to achieve it..
As for android:
First as logic part, you need to add some code in the native layer since hybrid apps usually can't interact from JavaScript side to native side in case app was not launched, so in order to wake the application on a specific event like notification received or any other actions that phone system can hold..
Second, as technical part, you need to add broadcast receivers and the receivers role stand to interact as native code with system. example in the link below:
https://www.digitalocean.com/community/tutorials/android-broadcastreceiver-example-tutorial
also another video about foreground and background broadcast receiver service in the link below:
https://www.youtube.com/watch?v=rlzfcqDlovg
video code output in git:
https://github.com/borntocoderepos/callrecorder
in the Youtube video example, the user is launching a toast message on phone call if app was opened or closed (background or foreground) so you can launch your app with intent with passing data and capture the data on app start as Deep Links as capacitor (https://capacitorjs.com/docs/guides/deep-links) or Cordova (https://ionicframework.com/docs/native/deeplinks)..
And instead of listening to network or phone calls, you can listen to Notifications and for sure you need to do searches about your topic and or the notification service that you'll choose.
Now for the video and the tutorial not sure of the quality of code so make sure to do more researches about the way its done from different places (could be outdated code or bad code quality or even not complete service and will discuss about this point below).
In android there is policy about using background and foreground services so once you start a service you need to end it after your done so make sure after you receive the notification and launch your app to stop the listening since it would cost power usage and perhaps could be stopped by Playstore as harmful app.
Now considering IOS it should be the same concept so make searches about this topic, but for IOS, the listeners policy as I remember , the receivers should not be waked up for more than 15 mins, so also keep this in mind and make sure you stop the receivers directly after launching your Hybrid app.
Broadcast equivalent receiver for IOS:
http://www.andrewcbancroft.com/2014/10/08/fundamentals-of-nsnotificationcenter-in-swift/

How can I fetch data from Firestore in background/terminated app status? - Flutter

In the past, I have used Firebase Cloud Messaging to send and receive notifications in my Flutter apps, but it is extremely limited in the notification types and ways to send notifications. I do not want to use Cloud Functions because they are complicated and I don't want to use the POST method because that makes it possible for keys and credentials to get leaked. My idea is to make a collection of notifications in each user Firestore document (which would need to be done anyways for in-app notifications) and then check in the app background for new notifications. Then if there are new notifications I would use awsome_notifications or another package to create customized notifications. I know this is possible when the app is open but cannot figure out how to do it in the background. I found a package https://pub.dev/packages/background_fetch but it seems complicated and I don't see any examples of actual code being called. I'm sure other people have tried something similar so are there any examples?

Is there a function to get push notifications in flutter? For example Facebook or Whatsapp notifications

I am wanting to develop an app similar to 'Notiduino' where it takes android notifications such as whatsapp message notifications or missed calls and retrieve them within the app. Is there any lib for this function? I searched and found nothing ...
Sorry for my bad english
Yes. You can use Overlay widgets. Combining them with a little bit of animation will give you effective UI. One example here and another is here.
You can also use Firebase in-app notification. Using Firebase in-app notification has one more advantage. You can also send push notifications from the same firebase project. Of course, relevant settings have to be made. Having said that, there are a bunch of web pages which will guide you through the step by step process.

Simple notifications when X condition is met

I'm developing a mobile application with flutter, everything so far is ok, my app needs to check a web API for some available online courses. The problem is, I want the app to notify me when a new course appear as a result of the API call, but I cannot see a proper way to do this even if I think is very simple, I'm not looking for push notifications, just normal notifications, but I cannot find a way to check the API while the app is not opened.
Reading, the flutter_local_notifications package (https://pub.dev/packages/flutter_local_notifications), is recommended, but this seems only to work while the app is opened, even if the example have a notification schedule for X days or time, is not what I need, I cannot see a proper way to check the API on background as everything I read use Isolates and very complex flutter solutions, or just native code (which sounds no complex for me but too much work for just to show a notification).
There is something I'm missing?, there is a simple way to set a callback to my app to check this API and in a true condition show a notification?, something else to have in mind is that as I'm using APIs I don't really like to use firebase for this, implement firebase just for one notification seems too much for me.
Any hints or help will be really appreciate.