FCM Push notification handler


#1

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.
Thanks


#2

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.


#3

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.

Thanks.


#4

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


#5

@Sujan12 thanks for reply,

I would try this and will update the progress.

Thanks,


#6

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

Thanks.


#7

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