How to setup Push Notifications with Flutter without Firebase and with own custom backend How to setup Push Notifications with Flutter without Firebase and with own custom backend dart dart

How to setup Push Notifications with Flutter without Firebase and with own custom backend


First to answer the question want to ask something.

  1. do you know how push notification works overall?
  2. And how backend notify mobile that something is changed?

To start with firebase works like this:

When backend fires push notification to the firebase server firebase sends a message on the XMPP server which is actively connected via google play services and the same goes for the apple APNs server.

Now when google play service will have this message it will contain the bundle id and something to identify which app to send. And that's why we register broadcast in android app manifest file. Just think about it broadcast do not get called without any send broadcast invoke and if you're not invoking the function then who does?

That part has been handled by the google play service to fire up your broadcast and let you know what push notifications you have received.

so my answer will be no do not use your backend to fire push notification because you need to then use your own XMPP server and let your app connected with a high priority which is currently impossible without showing the notification that you're doing something in the background (i.e. at least for android, ios will not remain in the background after 15min but you can extend by overriding some methods but still if apple reports you, you will not get chance to make app production ready.)

So for android either it's google services or any other services like say for and example azure notification still needs GCM token and key so you might want to reconsider what you are thinking at the moment.


why without Firebase?

fcm is free and backend can connect with it easily.

if u don't need to use Firebase u must create ur own service for android and ios