Helper apps should have access to the same user notifications as their parent app

Originator:robotspacer
Number:rdar://27034117 Date Originated:27-Jun-2016 02:53 PM
Status:Open Resolved:
Product:OS X SDK Product Version:10.11.5 (15F34)
Classification:Enhancement Reproducible:N/A
 
Summary:
For a Mac app it's not unusual to have a helper app that runs in the background even after the main app has quit. For a modern sandboxed app this is enabled with SMLoginItemSetEnabled. With App Groups enabled, they can share data and preferences, which makes most things pretty seamless.

However, it gets a bit messy if you need to display a notification to the user. Since it is a separate app, its notifications show up separately. There's no simple way to, say, clear a notification that was displayed by the helper app, or vice versa. They also have a different app name—unless their display name is set the same (though that no longer seems supported in Sierra). And of course they will both appear in the Notifications section of System Preferences, which is perhaps the most confusing part to someone using the app.

I was able to partially work around this by just having my helper app display all notifications. If the main app needs to display a notification and the helper app isn't already running, it will launch it. This generally works okay, except the main app MUST be the one to display badges—otherwise they'd never be seen. That means both apps still appear in the Notifications section of System Preferences, and my users are confused about why it's there twice.

Steps to Reproduce:
1. Create an app with a helper app using SMLoginItemSetEnabled.
2. Have the helper app create an NSUserNotification and display it using [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

Expected Results:
There should be some way to have that notification appear as though it is from the main app, with the same app name, and a single entry in System Preferences > Notifications.

Actual Results:
The system treats the app as though it's completely separate, with its own app name and a separate entry in System Preferences > Notifications.

Version:
10.11.5 (15F34)

Notes:

Configuration:
4GHz i7, 32GB RAM, 1TB SSD, M295X

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!