0

Is it possible to modify incoming push messages using @capacitor/push-notifications? I‘m sending messages using Firebase Cloud Messaging to my Android and iOS apps, which are encrypted by my backend and should be decrypted by the app. To achieve this, I must modify the messages shown in the notification centers after receiving them.

I didn‘t find any documentation on this, so I would appreciate any hint into achieving this. If this is not supported, is there any other solution I could use?

mtnair
  • 120
  • 5
  • Check this https://stackoverflow.com/questions/62533419/capacitor-ionic-handling-push-notification-in-background-or-when-app-was-killed – Talon Jun 07 '22 at 15:42
  • Check [this Question on StackOverflow](https://stackoverflow.com/questions/62533419/capacitor-ionic-handling-push-notification-in-background-or-when-app-was-killed) – Talon Jun 07 '22 at 15:44

1 Answers1

1

You can send a data notification (which is not automatically displayed by Android) and then use @capacitor/local-notifications to show the modified notification.

RGe
  • 1,181
  • 1
  • 10
  • 19
  • And what about iOS? In the docs, it says it doesn't support silent/data notifications. https://capacitorjs.com/docs/apis/push-notifications#silent-push-notifications-data-only-notifications – mtnair Jun 08 '22 at 11:09
  • 1
    You can use another plugin which supports silent notifications on iOS (e.g. [`@capacitor-firebase/messaging`](https://github.com/robingenz/capacitor-firebase)). – RGe Jun 08 '22 at 13:40