FCM Push notification handler


Using fcm plugin for push notification.
I need to go to a specific page while receiving the notification when the app is close and also needs to enable/disable receiving notification from the app.
Any solution is highly appreciated.


Put the page in the payload, handle the payload after the app is opened.

What exactly do you mean by that? You can have a flag “getNotifications” in your database that you set, then only push to users that have this flag set to true.


Thanks @Sujan12 for the reply.Well appreciated.

I have toggle button for enabling/disabling notification.But now thiscan’t control reception of notification.I need to control notification settings with the toggle buttons.



As I wrote, you sure can implement this in your own backend.
Most push plugins also have a unregister method that really disables push for this device: https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md#pushunregistersuccesshandler-errorhandler-topics


@Sujan12 thanks for reply,

I would try this and will update the progress.



After disabling notification for the device,can I be able to enable notification for the same device later on.
New to Ionic,still learning…



Sorry, no idea if this is possible. Probably yeah. Create a new topic if you want to ask the community.