abhimohata

abhimohata

CFUserNotificationDisplayAlert not showing alert window in macOS BigSur

I am intending to show an alert message in macOS through a C++ based application. I am using CFUserNotificationDisplayAlert for the same. Below is the piece of code that I have used to display the alert window which I have written in the .mm file:

CFOptionFlags cfRes;

CFUserNotificationDisplayAlert(0, kCFUserNotificationCautionAlertLevel,
                NULL, NULL, NULL,
                CFSTR("Message Header"),
                CFSTR("Message Body"),
                CFSTR("Ok"),
                NULL,
                NULL,
                &cfRes);

The above works fine on Catalina but does not show the alert window in BigSur. Is there anything I am missing ?

2 935 0

Where Next?

Popular Macos topics Top

AstonJ
When I purchased this Mac it was fast. However some months on and it is noticeably slower now, and where I notice it most is on starting ...
14 1196 7
New
AstonJ
I’m not sure if this is a Big Sur issue or whether I’ve just noticed it, but on looking at my hard drive usage it says I have used 465.0...
5 1526 7
New
siddhant3030
I have a new MacBook Pro which I’m connecting to an external monitor. I know why it is heating but I want to know if anyone having the sa...
3 879 8
New
DevotionGeo
Since we’re talking about Mac, which of the filesystems should I use on an external hard drive (non-SSD), which I’ll be using with my Mac...
10 1106 5
New
AstonJ
Just wasted hours trying to figure out why my Apple Magic keyboard 2 started lagging after the latest macOS upgrade - tried SMC and PRAM ...
1 1035 0
New
abhimohata
I am intending to show an alert message in macOS through a C++ based application. I am using CFUserNotificationDisplayAlert for the same....
2 935 0
New
dav
I’m searching for a tool that can (anonymously) collect crash reports from users of my macOS app (not iOS). Previously I used Fabric whic...
8 981 3
New
devovipul
I have JAR application ready. i have apple account also. Please give me steps to signed app upload i try But getting error as below : A...
2 793 1
New
leamas
Dear forum, New on macos. Need to create a .pkg file on the command line. The tooling seems to be pkgbuild(1) and productbuild(1). My pr...
3 1016 2
New
BadPistol97
I am trying to draw NSPanels on texts of other apps using AXObserverAddNotification with the attribute of kAXValueChangedNotification on ...
1 639 0
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
201 4638 102
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
116 8174 31
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
21 4800 7
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
37 2727 14
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
7 3059 3
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
29 4082 12
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
4 3745 1
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
21 5598 9
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
0 4367 0
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
54 4591 23
New