In swift remote notification is there a way to display a different message in the banner other than the one received from server when app is killed?

228 views Asked by At

If my payload from the server is

{   "aps" : {  "alert" : "You got a mail";
    "badge" : 0;
}
"user": { "name" : "Nicole" }  }`

And It also gives me some other data about the name of user who sent it . Is there a way to display custom message in the format : "Nicole sent a mail" in the notification center or banner ?

1

There are 1 answers

0
Frankenstein On

It is possible since iOS 10 by creating a Notification Service Extension. You can check the documentation for its details. Also, here is a good tutorial from Avanderlee that explains how to add Notification Service Extension to you app.