-1

I want to display a banner notification with a dark background and light text. iOS naturally does this if the phone is using dark mode. However, in light mode, when I use WhatsApp, I noticed banners have a dark theme as long as they are displayed while the application is in the foreground.

How can I create something similar? I've been looking into using UNNotificationContentExtension. This seems to work for custom actions displayed via a long click. For example, when I set view.backgroundColor, this does not set the background color for the whole banner. It only does it for custom actions.

user246392
  • 2,661
  • 11
  • 54
  • 96
  • 1
    WhatsApp has probably rolled there own UI workflow - this is evident based on the fact that it only works while the app is in the foreground. Maybe have a look at "ios toast" for some more ideas – MadProgrammer Aug 21 '22 at 23:59

1 Answers1

0

This isn't possible, since the system manages the creation of these alerts. This is probably restricted for consistent UI.