0

I have a notification content extension that displays a few different content/formats depending upon the payload content of the push, and so correspondingly have a few different categories that get set. Most of the notifications are expandable and when they are additional content is displayed.

However one of them I do not want it to be expandable, however currently is is and what happens is the content just gets stretched out. How can I prevent one content of notification from not expanding while retaining the ability for others to expand?

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378

1 Answers1

1

Whether a content extension is applied to a particular notification depends on its category. So you would just need to give the notification containing the "one content" yet another category, one that is matched by no content extension.

Even then, the notification banner still has what I call a "secondary interface" if you have given it an attachment. So if you don't want it to be expandable at all, don't give it an attachment.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • The category I use when I don't want the notification expanded is not in the extension plist. However the notification can still be expanded, the difference is if the category is in the extension then didReceive() gets called when expanded, without it in the plist then didReceive() is not called, but the notification still gets expanded - the title and body jump down to the bottom of the notification and the image attachment expands in size to fill the remaining space in the notification. – Gruntcakes Jun 29 '20 at 21:23
  • Oh I see what you mean. – matt Jun 29 '20 at 21:34
  • Don't include an image attachment. I'll that to my answer. – matt Jun 30 '20 at 00:32