Firebase: How to allow user to disable push notifications in Flutter? [duplicate] - android

This question already has answers here:
Disable Push notifications programmatically on Flutter
(1 answer)
Stop receiving push notifications in Flutter
(1 answer)
Closed 4 months ago.
I have added push notifications for my app in Flutter which are working fine but I also have a functionality where the user can disable the notifications.
How do I allow user to disable firebase push notifications?
Edit
I decided to use One Signal using the below steps
https://onesignal.com/blog/how-to-add-push-notifications-in-flutter-with-onesignal/

I'm supposing you're subscribing your user to a certain topic. With this in mind, you could use the unsubscribeFromTopic() method.
Also, you can read more about the firebase_messaging API and documentation here.

Related

How to send notification from one user to other in android studio using firebase [duplicate]

This question already has answers here:
How to send one to one message using Firebase Messaging
(5 answers)
Closed 1 year ago.
Please give the stepwise procedure to send the action notification from one user to other and after getting the notification , user have to give some response on the basis of that it may go to different activities.
Please suggest procedure/tutorial.
There are hundreds of tutorials online for various ways to do this, and they all depend on your framework, language, and available API
A good start would be Youtube
https://www.youtube.com/watch?v=wDpxBTjvPys

Display notification when app is destroyed [duplicate]

This question already has answers here:
Notification shows after android app is force closed
(4 answers)
Closed 4 years ago.
How can one display a system notification in android when the app is destroyed like most social messaging apps.
The best way to do this, is to use Firebase Cloud Messaging for your purpose.
https://firebase.google.com/docs/cloud-messaging/
Of course you can use Services to show Notifications from your app, but then you need to take care of your Services to keep your Services alive to update your messages and send notifications.

Android - Firebase Cloud Messaging Device to Device Push Notification Without Server [duplicate]

This question already has answers here:
How to send Device to device notification by using FCM without using XMPP or any other script.?
(3 answers)
Closed 5 years ago.
Is there a way to send push notification between 2 android devices without a server?
I found some tutorials but all of them was using the node.js for sending a notification. (Or I found that some samples that were using the firebase console for doing this)
Nope,
You need a "server" to do push notification. You can use a variety of services to do that, as you mentioned firebase is one of them. You may not need a full on server, but you need some kind of service to do that, you can't simply send notifications between devices straight away:
Some examples are:
AWS Serverless functions
Cloud functions in firebase
If you'd rather use one of these services, then you'll need to configure FCM in your app, you can check how to do that in the docs. And some nice sample codes here :)

What is the Firebase code for android that will help send notification of a message? [duplicate]

This question already has answers here:
Is it possible to send PushNotifications, using Firebase Cloud Messaging (FCM) to special UDID, directly from device?
(6 answers)
Closed 6 years ago.
I need the android code for firebase that will send a notification when a user sends a message from one android phone.
eg: When I use Whats App for example if User A sends a message to User B, then a notification is sent to user B device when User B clicks on it, the page opens. How to do this via only firebase and no other server, I have searched all the Firebasse docs... In the notification only Server to device is given.. I am making a chat app and only this feature is remaining.
You can try this code and customize as per your need... i also used this code to customize my chatting application
You have to add notification code inside the following method in Chat.java class
FirebaseDatabase.getInstance().getReference("messages").addListenerForSingleValueEvent();
...And if you want to receive notifications when your app is not running or close like whatsapp. You have to create an android service for notification that will run continuously in the background.

Schedule a push notification with Firebase Cloud Messaging [duplicate]

This question already has answers here:
FCM Schedule delivery date or time of push notification
(2 answers)
Closed 6 years ago.
I'm integrating push notifications in an app I'm developing. I have chosen to use Firebase Cloud Messaging (FCM) to support both Android and iOS.
When using the console to send a push message I see there is an option to delay the actual sending of the push notification. However when checking the HTTP docs I can't seem to find this option.
How would I schedule a notification so it is send at a later time using FCM and the HTTP API?
Unfortunately, as of the moment, there is no API or even a parameter that you can use in order to schedule a notification.
It can only be done either (as you already know) in the Firebase Console or implementing a delay until the schedule in your own App Server.

Categories

Resources