0

I have a payload coming in from a web service and part of what I receive is this:

[AnyHashable("aps"): {
alert = "Message from Web service";
sound = default;
}

And when I receive a notification when app is in the background, it will show the notification banner with the "Message from Web service" string. How do I change this string? I'm checking and I don't see any functions being called when app is receiving notifications in the background.

Thanks.

alwongg
  • 51
  • 5
  • 4
    change what the web service sends. – Scriptable Nov 08 '18 at 15:45
  • What if I want to handle this without web service change? – alwongg Nov 08 '18 at 15:48
  • I dont think you can 'intercept' and change the contents of a push notification before it is shown. it is received and shown and your app is notified about it. thats it. – Scriptable Nov 08 '18 at 15:50
  • other option is to send a silent notification from the web service instead and present your own local one with the modifications: https://stackoverflow.com/questions/49621956/how-to-change-how-a-remote-notification-is-presented-before-presentation/49622282#49622282 – Scriptable Nov 08 '18 at 15:52

0 Answers0