Dynamic, Custom-UI MacOS Notifications in Notification-Center. How to?

Hi, I have a long process that I need to report to the User via UNNotificationCenter (local) notifications. Say - scanning a big folder with thousands of files, finding and reporting "bad ones" as they are identified.

I currently emit periodic notifications, keeping the same "thread identifier", which causes each new notification to replace the one displayed, thus updating the texts.

However - when they become many, the behavior is inconsistent and it looks bad.

What I'd like to do is: Have a single DELIVERED notification (displayed on-screen) that will change its contents (say- advances a progress bar, and updates its text periodically.

I KNOW that this is possible, because Apple publishes a notification almost identical to what I need in AirDrop UI. When a bunch of documents are dropped by some external device onto my Mac - I receive a notification like this:

Which updates until the file transfer is finished.

I searched both these forums, the documentation, and other resources, but did NOT find any hint on how to implement such thing.

There's something for iOS called "App Extension" that can customize Notification UI - but I did not find any documentation or code-sample or anything - and all I found was descriptions of behavior on iOS, so I'm not sure that's the way to do it on MacOS.

Can you please advise?

  • No one? really?... it's sad.

Add a Comment

Replies

Hi! Have you found a solution?

You're the only reply... and I did not find any information whatsoever. If you find anything - please also remember me and paste here

  • Thank you, I already found these two sources, and while the first (Apple documentation) seems to be the thing I'm trying to do - it is iOS only, and there is absolutely no hint on how to implement this on the Mac. The whole setup there is iOS-focused, and I don't know how to even create a template for this special "notification extension" target type in Xcode, and whether or not this is supported. Apple really leaves me in the dark here - Maybe the APIs are private?

  • Also, in the second resource (StackOverflow question+answer) the guy who answered - referred to the above "customizing_the_appearance_of_notifications" as "iOS only, not available on MacOS" - but he didn't say why he thought that.

Add a Comment