How to push up notifications from backend with flutter without firebase nor one signal? - flutter

I have searched Google, YouTube and stack overflow for the answer but I haven't found any real solution.
I want to implement my own push notification solution on flutter, without firebase nor One signal. I do not want to depend on a third party service.
My Backend is on GoLang with graphql.
On the frontend, I am using a block pattern (flutter_bloc v6) and graphql_flutter v4.
I am using graphql subscriptions, so whenever the Backend emits a signal, the flutter app is able to receive it immediately.
I would like to be able to push up notifications to my users whenever the Backend sends some information, no matter if the app is on the foreground, background, closed or whatever. I do not want scheduled notifications either (aka flutter_local_notifications)

Do you want to use a third service other than firebase/one signal?
Then you can try airship(https://docs.airship.com/reference/messages/message-types/push-notifications/)
But if you want to setup your own provider server, please check this page(https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server), this is the start point, from where you can start your investigation and development.

Then you have to create your own backend system to send push notifications to the device. You have to develop Native Application for iOS and Android going beyond flutter. The local push notification could be used but you need to develop a custom notification receiver that will respond to the notification call back from the server in the background.

Related

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/

Move flutter (dart) function to foreground service ANDROID

Im working on the app sends list of data to server one by one in foreground with progress indication via push notification to user. I need to send the data to server even the app is killed with the progress indication using the android service.
Is this possible? If not please suggest me any other solutions or techniques.

How to implement Callkeep with Agora in Flutter?

I have to create call application with help of Agora. When app is in foreground it is okay, but i want to accept calls when app is on background or terminated. I am trieng to use Callkeep plugin for accepting calls of background
I found a way via FCM background message,but i dont know how to implement solutiion for IOS,it does not have FCM background message
I tried use VOIP notification, but i dont know how to send them to my flutter app
I use Firebase as a backend
I need solution for both Android and IOS
Thanks
For IOS you will have to implement a server side script that will send VOIP Push notifications to the user before the real VOIP call comes in. From what I know, you cannot user Firebase for this.
Please refer to https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit to know more about the changes about handling VOIP calls in background.
Also, refer to https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit to know more about sending VOIP Push notifications on server side.

How to make a Flutter app listen to incoming calls using WebRTC and Web Socket for signalling

been looking for the answer over a few days but no luck so I think I better ask SO. Here is my scenario: I'm trying to create a Flutter WebRTC video call app which is similar to WhatsApp or Viber. I use a simple web socket to do signalling so that I can display caller name when there is an incoming call from the other end and depends on callee's action like Accept and Reject the call they can either engage or just simply hang up the call. All working well so far. The problem however I'm facing is when either parties not using the app, the other party can't make a call because they can't send the signal. I think when the app is not running its not connecting to the web socket. How can I make the app keep listening efficiently to call signal events even its not running? Thanks
You need something that notifies the application that there's some incoming call/data even when the application is not running.
I'll recommend to use Firebase Notification Service. Although you can also use Pushy or Pusher Beam for this task.
Upon receiving the notification, you can perform desired task based on the data payload received through the notification.

Flutter own push notifications (store agnostic)

I was wondering, given that Flutter is multi platform and each store requires its own procedure for the final step of setting up Push notifications, would it be worthwhile to implement a full "flutter proprietary push notification system" something that would ignore completely the Android/iOS and other stores implementation?
The main service that the store provides is to "find" the device in the final step of the push, this could be replaced with:
a subscribe / ack of this flutter layer to a server (whenever the app declares that it wants to use it), that will send the message when required (with a messaging queue?)
an always on instance on the phone to actually receive the push (this is probably the most critical part)
UPDATE: I am realising that this necessity will probably be covered by some sort of third party provider, such as what Crashlytics has done with error and crash reports.
Operating system push notification services (OSPNS) are provided by the Android and iOS and other platforms. If you want your messages to be shown as notifications on the notification tray/status bar you have to configure it as required by that platform and there is no other option for this. If you want to use only one push service than Huawei Push Kit might be the one to choose since it can send push notifications to all platforms Android, iOS, Huawei devices and also Web.
This is almost impossible.
Because on the basis of Android, there is a part handled by the OS in the case of push, so even if the app does not reside in memory, it can be processed. If you're going to create a Flutter-only Push system, the Flutter app should always be running as a background service (iOS is a different issue).
If you only want to be able to use push while the Flutter app is running, that might be the way to go. However, it will be difficult after the app is closed.
url link : https://developer.android.com/reference/android/app/NotificationManager