2

I have an app in which I am using an FCM notification when there is an event from server.

I want to get the notification data and update the message from one of the parameter from Notification Payload when app is in background, foreground or killed.

I have tried to use Silent Push Notification with Content Available but when my app is killed, then I am unable to receive callback in my App delegate.

I have tried lots of links from StackOverflow but could not get the perfect suggestion.

If you find duplicate, then please provide me the link but solution with different iOS (12,13,14,15) versions.

My problem is just like this Stack Link

James Z
  • 12,209
  • 10
  • 24
  • 44
Manthan
  • 3,856
  • 1
  • 27
  • 58

1 Answers1

2

It sounds like what you want is a Notification Service Extension. This is a separate binary (packaged with your app) that can run when a notification is received. Your extension can intercept the push-notification payload, and modify it, so that other things can be displayed.

https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension

This is also really good, too. https://www.raywenderlich.com/8277640-push-notifications-tutorial-for-ios-rich-push-notifications

Dharman
  • 30,962
  • 25
  • 85
  • 135
Dan Morrow
  • 4,433
  • 2
  • 31
  • 45