0

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/

Teknoville
  • 459
  • 1
  • 7
  • 18

1 Answers1

0

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.

Mike4544
  • 123
  • 1
  • 6
  • I am not subscribing the user to any topic.Its just some general notifications I was sending. – Teknoville Nov 06 '22 at 12:11
  • Then you can use the `deleteToken()` method when disabling, and the `getToken()` method when enabling the notifications back. – Mike4544 Nov 06 '22 at 12:19