In macOS, how can I use UnmutableNotificationContent notifications to prevent the main window from activating when clicking the notification?
code:
import Cocoa
import UserNotifications // Mandatory import for notification functionality
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Automatically request permissions and send a test notification when the view loads
sendLocalNotification()
}
/// Core method to send a local notification
func sendLocalNotification() {
let notificationCenter = UNUserNotificationCenter.current()
// 1. Request notification permissions (Mandatory step; user approval required)
notificationCenter.requestAuthorization(options: [.alert, .sound, .badge]) { [weak self] isGranted, error in
guard let self = self else { return }
// Handle permission request errors
if let error = error {
print("Permission request failed: \(error.localizedDescription)")
return
}
// Exit if user denies permission
if !isGranted {
print("User denied notification permissions; cannot send notifications")
return
}
// 2. Construct notification content using UNMutableNotificationContent
let notificationContent = UNMutableNotificationContent()
notificationContent.title = "Swift Notification Test" // Notification title
notificationContent.subtitle = "macOS Local Notification" // Optional subtitle
notificationContent.body = "This is a notification created with UNMutableNotificationContent" // Main content
notificationContent.sound = .default // Optional notification sound (set to nil for no sound)
notificationContent.badge = 1 // Optional app icon badge (set to nil for no badge)
// 3. Set trigger condition (here: "trigger after 3 seconds"; can also use time/calendar triggers)
let notificationTrigger = UNTimeIntervalNotificationTrigger(
timeInterval: 3, // Delay in seconds
repeats: false // Whether to repeat (false = one-time only)
)
// 4. Create a notification request (requires a unique ID for later cancellation if needed)
let notificationRequest = UNNotificationRequest(
identifier: "SwiftMacNotification_001", // Unique identifier
content: notificationContent,
trigger: notificationTrigger
)
// 5. Add the request to the notification center and wait for triggering
notificationCenter.add(notificationRequest) { error in
if let error = error {
print("Notification delivery failed: \(error.localizedDescription)")
} else {
print("Notification added to queue; will trigger in 3 seconds")
}
}
}
}
}
Notifications
RSS for tagLearn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
Hello,
I recently had an unusual experience, and I’m wondering if this is related to Apple’s policies, so I wanted to ask.
While a call is in Picture-in-Picture (PIP) mode, notification pushes from the same app do not appear.
The API is being triggered, but the notification banner does not show on the device.
Once PIP is closed, the notifications start appearing normally again.
Is this behavior enforced by Apple’s policies?
What’s interesting is that banners from other apps do appear — only the banners from the app currently in PIP are not shown.
We are implementing a camera intercom calling feature using VoIP Push notifications (PushKit) and LiveCommunicationKit (iOS 17.4+). The app works correctly when running in foreground or background, but fails when the app is completely terminated (killed by user or system). After accepting the call from the system call UI, the app launches but gets stuck on the launch screen and cannot navigate to our custom intercom interface.
Environment
iOS Version: iOS 17.4+ (testing on latest iOS versions)
Xcode Version: Latest version
Device: iPhone (tested on multiple devices)
Programming Languages: Objective-C + Swift (mixed project)
Frameworks Used: PushKit, LiveCommunicationKit (iOS 17.4+)
App State When Issue Occurs: Completely terminated/killed
Problem Description
Expected vs Actual Behavior
App State Behavior
Foreground ✅ VoIP push → System call UI → User accepts → Navigate to intercom → Works
Background ✅ VoIP push → System call UI → User accepts → Navigate to intercom → Works
Terminated ❌ VoIP push → System call UI → User accepts → App launches but stuck on splash screen → Cannot navigate
Root Issues
When app is terminated and user accepts the call:
Data Loss: pendingNotificationData stored in memory is lost when app is killed and relaunched
Timing Issue: conversationManager(_:perform:) delegate method is called before homeViewController is initialized
Lifecycle Confusion: App initialization sequence when launched from terminated state via VoIP push is unclear
Code Flow
VoIP Push Received (app terminated):
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType,
completion: @escaping () -> Void) {
let notificationDict = NotificationDataDecode.dataDecode(payloadDict) as? [AnyHashable: Any]
let isAppActive = UIApplication.shared.applicationState == .active
// Store in memory (PROBLEM: lost when app is killed)
pendingNotificationData = isAppActive ? nil : notificationDict
if !isAppActive {
// Report to LCK
try await conversationManager.reportNewIncomingConversation(uuid: uuid, update: update)
}
completion()
}
User Accepts Call:
func conversationManager(_ manager: ConversationManager, perform action: ConversationAction) {
if let joinAction = action as? JoinConversationAction {
// PROBLEM: pendingNotificationData is nil (lost)
// PROBLEM: homeViewController might not be initialized yet
if let pendingData = pendingNotificationData {
ModelManager.share().homeViewController.gotoCallNotificationView(pendingData)
}
joinAction.fulfill(dateConnected: Date())
}
}
Note: When user taps "Accept" on system UI, LiveCommunicationKit calls conversationManager(_:perform:) delegate method, NOT a manual acceptCall method.
Questions for Apple Support
App Lifecycle: When VoIP push is received and app is terminated, what is the exact lifecycle? Does app launch in background first, then transition to foreground when user accepts? What is the timing of application:didFinishLaunchingWithOptions: vs pushRegistry:didReceiveIncomingPushWith: vs conversationManager(_:perform:)?
State Persistence: What is the recommended way to persist VoIP push data when app is terminated? Should we use UserDefaults, NSKeyedArchiver, or another mechanism? Is there a recommended pattern for this scenario?
Initialization Timing: When conversationManager(_:perform:) is called with JoinConversationAction after app launch from terminated state, what is the timing relative to app initialization? Is homeViewController guaranteed to be ready, or should we implement a waiting/retry mechanism?
Navigation Pattern: What is the recommended way to navigate to a specific view controller when app is launched from terminated state? Should we:
Handle it in application:didFinishLaunchingWithOptions: with launch options?
Handle it in conversationManager(_:perform:) delegate method?
Use a notification/observer pattern to wait for initialization?
Completion Handler: In pushRegistry:didReceiveIncomingPushWith, we call completion() immediately after starting async reportNewIncomingConversation task. Is this correct, or should we wait for the task to complete when app is terminated?
Best Practices: Is there a recommended pattern or sample code for integrating LiveCommunicationKit with VoIP push when app is terminated? What are the best practices for handling app state persistence and navigation in this scenario?
Attempted Solutions
Storing pendingNotificationData in memory → Failed: Data lost when app is killed
Checking UIApplication.shared.applicationState → Failed: Doesn't reflect true state during launch
Calling gotoCallNotificationView in conversationManager(_:perform:) → Failed: homeViewController not ready
Additional Information
Singleton pattern: LCKCallManagerSwift, ModelManager
homeViewController accessed via ModelManager.share().homeViewController
Mixed Objective-C and Swift architecture
conversationManager(_:perform:) is called synchronously and must call joinAction.fulfill() or joinAction.fail()
Requested Help
We need guidance on:
Correct app lifecycle handling when VoIP push is received in terminated state
How to persist VoIP push data across app launches
How to ensure app initialization is complete before navigating
Best practices for integrating LiveCommunicationKit with VoIP push when app is terminated
Thank you for your assistance!
Topic:
App & System Services
SubTopic:
Notifications
We are facing an issue: push notifications are not being received. We are using the Marketing Cloud SDK for push notifications.
On install, the app correctly registers for push notifications. We pass the required information to Marketing Cloud — for example, contact key, token, etc. Marketing Cloud also confirms that the configuration is set up, and we have tried sending push notifications with proper delivery settings.
The issue is that after some time, the device gets automatically opted out in the Marketing Cloud portal. When we consulted their team, they said this is caused by the “DeviceTokenNotForTopic” error received from APNs. I have verified the certificates and bundle ID from my end — everything looks correct.
Device: iPhone 15, iPhone 17
iOS: 18.7.2, 26.1
I’m building a firefighter app that needs to automatically check in a firefighter when they arrive at the station and check them out when they leave — even if the app is killed. We need reliable enter/exit detection, low latency, and only one fixed location per user.
We’re evaluating Region Monitoring, which works in the killed state but may introduce delays and inconsistent accuracy. To ensure mission-critical reliability, we are considering the Location Push Service Extension, since it can fetch precise location on demand and wake the extension even when the app is terminated.
Before requesting the restricted entitlement, we need clarification on Apple’s expectations:
Is Region Monitoring recommended for this fixed-location use case?
Would Apple consider approving the Location Push Service Extension for a public-safety workflow?
What prerequisites do we need before submitting the entitlement request (Always permission, prototype, privacy disclosures, etc.)?
What details should be included in the justification form?
Our goal is to follow the most reliable and Apple-approved approach for firefighter check-in/out. Any guidance would be greatly appreciated.
Hi, We recently updated our app icon, but the push notification icon has not been updated on some devices. It still shows the old icon on: • iPhone 16 Pro — iOS 26 • iPhone 14 — iOS 26 • iPad Pro 11” (M4) — iOS 18.6.2 • iPhone 16 Plus — iOS 18.5
After restarting these devices, the push notification icon is refreshed and displays the new version correctly.
Could you advise how we can ensure the push notification icon updates properly on all affected devices without requiring users to restart?
Thank you.
Hi,
We recently updated our app icon, but the push notification icon has not been updated on some devices. It still shows the old icon on:
• iPhone 16 Pro — iOS 26
• iPhone 14 — iOS 26
• iPad Pro 11” (M4) — iOS 18.6.2
• iPhone 16 Plus — iOS 18.5
After restarting these devices, the push notification icon is refreshed and displays the new version correctly.
Could you advise how we can ensure the push notification icon updates properly on all affected devices without requiring users to restart?
Thank you.
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
Developer Tools
iOS
User Notifications
Provisioning profiles created for my App ID are not including the Push Notifications capability, even though Push Notifications is enabled in the App ID configuration in Apple Developer Portal.
I have enabled Push Notifications for my App ID (com.abc.app) in the Apple Developer Portal. The capability shows as enabled and saved. However, when provisioning profiles are generated (either manually or through third-party tools like Expo Application Services), they do not include:
The Push Notifications capability
The aps-environment entitlement
This results in build failures with the following errors:
Provisioning profile "*[expo] com.abc.app AppStore [timestamp]" doesn't support the Push Notifications capability.
Provisioning profile "*[expo] com.abc.app AppStore [timestamp]" doesn't include the aps-environment entitlement.
Steps Taken
✅ Enabled Push Notifications in App ID configuration (com.mirova.app)
✅ Saved the App ID configuration multiple times
✅ Waited for Apple's systems to sync (waited 5-10 minutes)
✅ Removed and re-added Push Notifications capability (unchecked, saved, re-checked, saved)
✅ Created Push Notification key in Apple Developer Portal
✅ Verified Push Notifications is checked and saved in App ID
❌ Provisioning profiles still created without Push Notifications capability
Expected Behavior
When Push Notifications is enabled for an App ID, any provisioning profiles created for that App ID should automatically include:
Push Notifications capability
aps-environment entitlement (set to production or development)
Actual Behavior
Provisioning profiles are created without Push Notifications capability, even though:
Push Notifications is enabled in App ID
App ID configuration is saved
Sufficient time has passed for sync
Additional Information
Push Notification Key: Created and valid (Key ID: 3YKQ7XLG9L and 747G8W2J68)
Distribution Certificate: Valid and active
Provisioning Profile Type: App Store distribution
Third-party Tool: Using Expo Application Services (EAS) for builds, but issue persists with manually created profiles as well
Questions
Is there a delay or sync issue between enabling Push Notifications in App ID and it being available for provisioning profiles?
Are there any additional steps required to ensure Push Notifications is included in provisioning profiles?
Is there a known issue with Push Notifications capability not being included in provisioning profiles?
Should I create the provisioning profile in a specific way to ensure Push Notifications is included?
Environment
Platform: iOS
Build Type: App Store distribution
Xcode Version: (via EAS cloud build)
Thank you for your assistance. I've been unable to resolve this issue and would appreciate any guidance.
iOS Deployment Target: Latest
We are in the process of preparing our app to support the new Texas law (SB2420) that takes effect 1/1/2026.
After reviewing Apple's recent announcements/docs concerning this subject, one thing isn't clear to me: how to associate an app install with an App Store Server RESCIND_CONSENT notification that could be delivered to our server.
Our app is totally free so there isn't an originalTransactionId or other similar transaction IDs that would be generated as part of an in-app purchase (and then subsequently sent as part of the payload in the notification to our server during an in-app purchase scenario).
So my question is: How do I associate an app (free app) install with an App Store Server RESCIND_CONSENT notification that is sent to our server?
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Store Server Notifications
Declared Age Range
I got notification filtering permission from appStoreConnect, i.e. com.apple.developer.usernotifications.filtering, but not able to suppress notification even after setted contentHandler(UNNotificationContent()) and contentHandler(UNMutableNotificationContent()).
Added entitlements in both extension and main app, also in signing profile these Entitlements are visible, what other changes should I do?
Topic:
App & System Services
SubTopic:
Notifications
We are observing an issue where the iOS Notification Service Extension (NSE) is terminated by the system during startup, before either didReceive(_:withContentHandler:) or serviceExtensionTimeWillExpire(_:) is invoked. When this occurs, the notification is delivered without modification (for example, an encrypted payload is shown to the user). System logs frequently contain the message “Extension will be killed because it used its runtime in starting up”.
During testing, we observed that CPU-intensive operations or heavy initialization performed early in the extension lifecycle — especially inside init() or directly on the main thread in didReceive often cause the system to kill the NSE almost immediately. These terminations happen significantly earlier than the commonly observed ~30-second execution window where the OS normally invokes serviceExtensionTimeWillExpire(_:) before ending the extension. When these early terminations occur, there is no call to the expiry handler, and the process appears to be forcefully shut down.
Moving the same operations to a background thread changes the behavior: the extension eventually expires around the usual 30-second window, after which the OS calls serviceExtensionTimeWillExpire(_:).
We also observed that memory usage plays a role in early termination. During tests involving large memory allocations, the system consistently killed the extension
once memory consumption exceeded a certain threshold (in our measurements, this occurred around 150–180 MB). Again, unlike normal time-based expiration, the system did not call the expiry handler and no crash report was produced.
Since Apple’s documentation does not specify concrete CPU, memory, or startup-cost constraints for Notification Service Extensions or any other extensions beyond the general execution limit, we are seeking clarification and best-practice guidance on expected behaviors, particularly around initialization cost and the differences between startup termination.
NSE Setup:
class NotificationService: UNNotificationServiceExtension {
static var notificationContentHandler: ((UNNotificationContent) -> Void)?
static var notificationContent: UNMutableNotificationContent?
static var shoudLoop = true
override func didReceive(_ request: UNNotificationRequest,
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
NotificationService.notificationContentHandler = contentHandler
NotificationService.notificationContent =
request.content.mutableCopy() as? UNMutableNotificationContent
NotificationService.notificationContent!.title = "Weekly meeting"
NotificationService.notificationContent!.body = "Updated inside didReceive"
// Failing scenarios
}
override func serviceExtensionTimeWillExpire() {
NotificationService.shoudLoop = false
guard let handler = NotificationService.notificationContentHandler,
let content = NotificationService.notificationContent else { return }
content.body = "Updated inside serviceExtensionTimeWillExpire()"
handler(content)
}
}
Hi Team,
We are building oru subscrption app and want to rely on server side purchase / subscription related notifications. We went through
https://developer.apple.com/documentation/appstoreservernotifications/enabling-app-store-server-notifications
We wanted to understand the reliability and latency for server side notifciations provided by Appstore.
Hi everyone,
I'm developing a custom Apple Wallet pass using a Django backend and exposing my local server through ngrok during development. For the first ~30 minutes, everything works exactly as expected: the pass registers correctly, silent push notifications trigger instant updates, Wallet immediately performs the GET request to fetch the new .pkpass, and the changeMessage displays almost instantly on the lock screen.
At some point, however, the pass stops updating entirely. Apple APNs continues to return 200 OK for every silent push I send, but the device never performs the required GET /v1/passes// call to download the updated pass. As a result, even the internal content of the pass (ex: points/balance fields) no longer updates, which confirms that Wallet is not fetching the new .pkpass at all. No changeMessage appears either.
This behavior has been described informally by other developers as Apple Wallet Pass Update Throttling, where the Wallet daemon begins ignoring silent pushes after repeated updates or certain internal conditions. I’m trying to confirm whether this is indeed throttling, what triggers it, and how to avoid it during development.
Having some discussion about when we should clear out a token from our servers.
Docs say:
Don’t retry notification responses with the error code BadDeviceToken, DeviceTokenNotForTopic, Forbidden, ExpiredToken, Unregistered, or PayloadTooLarge. You can retry with a delay, if you get the error code TooManyRequests.
The way I see it is that with the exception of PayloadTooLarge, all other errors means you should remove the token from your server. Either because:
The token is no longer good
The token is good, but this is just not the right:
environment (sandbox vs production)
topic (the token is from a different bundle id or developer team)
target (app vs live activity appex)
Do I have it right?
Extra context: when using the "JSON Web Token Validator" tool, a colleague reported that a 410 -Expired token (from couple days back) was still valid today. This raises questions about when tokens should actually be deleted and how these error codes should be interpreted.
Also is it possible for the docs to get updated for us to explicitly know if a token should get removed and not leave it for interpretation?
We have been getting several reports in the past 2 weeks of APNs notifications being either heavily delayed or not delivered at all.
We have two apps, one of which has a Notification Service Extension and one of which does not. We have had users of both reporting sporadic notification problems.
Looking at the sysdiagnose logs from one example, it looks like the notification was actually processed by our notification extension in a timely fashion, but was not displayed to the user.
An example event we investigated it the following (now perhaps a little long in the tooth):
2025-10-31T14:32:54
apnsId=EE3E002D-26DE-B4F5-5E9B-5E0C1E1B6B3D
We think we have correlated this with device logs:
default 2025-10-31 10:32:54.472054 -0400 [EDE9521D-8A65-4588-8AE8-D3D78B9E5EA5] Received replacement content for notification request 859D-ABC7 [ hasContent: 1 attachments: 0 ]
However there is no other reference until the app was launched about 1.5 minutes later:
default 2025-10-31 10:34:26.875327 -0400 [..] Got 1 delivered notifications [ hasCompletionHandler: 1 ]
When trying to reproduce, when I saw notifications bannered, the trace I saw was "Got 0 delivered notifications". What's the significance of "Got 1 delivered notifications" in this case?
Historically, SpringBoard logs have shown detailed trace about the handling of notifications (which was very useful in narrowing down the slowness of notifications due to Apple Intelligence, reported on our side as FB16253547, which doesn't seem to have been triaged but it looks like was resolved around iOS 18.2.1 or iOS 18.3); however it seems that now sysdiagnoses are only containing <1 minute of trace from SpringBoard.
Is there any way to extend the trace from SpringBoard that is included in sysdiagnoses?
I see there was also https://developer.apple.com/forums/thread/806367 around the same time we started receiving reports. However I think my hypothesis is that this is a client-side issue, and notifications are being delivered to devices, just not presented correctly.
Will try and collect a bit more data and file some Feedbacks and provide them here, but wanted to also flag here in case there are any others experiencing similar.
In didFinishLaunchingWithOptions I have this setup for getting the token to send to my server for notifications. The issue is that the delegate callback didRegisterForRemoteNotificationsWithDeviceToken gets called twice when also initializing a CKSyncEngine object.
This confuses me. Is this expected behavior? Why is the delegate callback only called twice when both are called, but not at all when only using CKSyncEngine.
See code and comments below.
/// Calling just this triggers `didRegisterForRemoteNotificationsWithDeviceToken` once.
UIApplication.shared.registerForRemoteNotifications()
/// When triggering the above function plus initializing a CKSyncEngine, `didRegisterForRemoteNotificationsWithDeviceToken` gets called twice.
/// This somewhat make sense, because CloudKit likely also registers for remote notifications itself, but why is the delegate not triggered when *only* initializing CKSyncEngine and removing the `registerForRemoteNotifications` call above?
let syncManager = SyncManager()
/// Further more, if calling `registerForRemoteNotifications` with a delay instead of directly, the delegate is only called once, as expected. For some reason, the delegate is only triggered when two entities call `registerForRemoteNotifications` at the same time?
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
UIApplication.shared.registerForRemoteNotifications()
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
print("didRegisterForRemoteNotificationsWithDeviceToken")
}
I'm experiencing a critical regression on iOS 26 with a Notification Content Extension. extensionContext.open(uri) fails to open external URLs with LSApplicationWorkspaceErrorDomain Code=115 under specific conditions.
Problem:
When the main app is killed, and a rich push notification is received and expanded, tapping a button (specifically one with a transparent background, cornerRadius=0, clipsToBounds=false) fails to open its associated URL.
Key Details:
iOS 26 Only: Works perfectly on iOS 17, 18, etc.
App Killed State Only: Works if the app is running (foreground/background).
Works on Subsequent Notifications: The link will open if a second notification is received.
LSApplicationQueriesSchemes: Confirmed to be correctly configured in the main app's Info.plist and present in the app bundle.
Delay No Help: Adding a 1s delay before open(uri) does not fix it.
My os_log statements confirm the button tap
We are encountering the following issue with our VoIP application for iPhone, published on the App Store, and would appreciate your guidance on possible countermeasures.
The VoIP application (callee side) utilizes a Wi-Fi network. The sequence leading to the issue is as follows:
VoIP App (callee): Launches
iPhone (callee): Locks (e.g., by short-pressing the power button)
VoIP App (callee): Transitions to a suspended state
VoIP App (caller): Initiates a VoIP call
VoIP App (callee): Receives a local push notification
VoIP App (callee): Answers the incoming call
VoIP App (callee): Executes performAnswerCallAction()
After this, the VoIP App (callee) uses "NSTimer scheduledTimerWithTimeInterval" to manage internal processing timing. However, the processing sometimes takes longer than the specified waiting time. Specifically, delays of several seconds can occur.
We understood that if the user is interacting with the screen and both the iPhone and the VoIP app are in an active state, the VoIP app's processing would not be delayed. However, can significant delays (several seconds) in application processing still occur even when the iPhone is in an active state (i.e., the user is interacting with the screen)?"
We are encountering the following issue with our VoIP application for iPhone, published on the App Store, and would appreciate your guidance on possible countermeasures.
The VoIP application (callee side) utilizes a Wi-Fi network. The sequence leading to the issue is as follows:
VoIP App (callee): Launches
iPhone (callee): Locks (e.g., by short-pressing the power button)
VoIP App (callee): Transitions to a suspended state
VoIP App (caller): Initiates a VoIP call
VoIP App (callee): Receives a local push notification
VoIP App (callee): Creates a UDP socket for call control (for SIP send/receive)
VoIP App (callee): Creates a UDP socket for audio stream (for RTP send/receive)
VoIP App (callee): Exchanges SIP messages (INVITE, 100 Trying, 180 Ringing, etc.) using the call control UDP socket
VoIP App (callee): Answers the incoming call
VoIP App (callee): Executes performAnswerCallAction()
Immediately after executing performAnswerCallAction() in the above sequence, the sendto() function for both the "UDP socket for call control (SIP send/receive)" and the "UDP socket for audio stream (RTP send/receive)" occasionally returns errno = 57 (ENOTCONN). (of course The VoIP app itself does not close the sockets in this timing)
Given that the user has performed an answer operation, the iPhone is in an active state, and the VoIP app is running, what could be the possible reasons why the sockets suddenly become unusable?
Could you please provide guidance on how to avoid such socket closures?
Our VoIP app uses SCNetworkReachabilitySetCallback to receive network change notifications, but no notifications regarding network changes were received at the time errno = 57 occurred.
Is it possible for sockets used by an application to be closed without any notification to the application itself?
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
User Notifications
PushKit
Push To Talk
I’m testing remote push notifications on macOS, and although notifications are received and displayed correctly, my Notification Service Extension (NSE) never gets invoked.
The extension is properly added as a target in the same app, uses the UNNotificationServiceExtension class, and implements both didReceive(_:withContentHandler:) and serviceExtensionTimeWillExpire(). I’ve also set "mutable-content": 1 in the APNS payload, similar to how it works on iOS — where the same code correctly triggers the NSE. On macOS, however, there’s no sign that the extension process starts or the delegate methods are called.
import UserNotifications
class NotificationService: UNNotificationServiceExtension {
override func didReceive(_ request: UNNotificationRequest,
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
let modified = (request.content.mutableCopy() as? UNMutableNotificationContent)
modified?.title = "[Modified] " + (modified?.title ?? "")
contentHandler(modified ?? request.content)
}
override func serviceExtensionTimeWillExpire() {
// Called if the extension times out before finishing
}
}
And the payload used for testing:
{
"aps": {
"alert": {
"title": "Meeting Reminder",
"body": "Join the weekly sync call"
},
"mutable-content": 1
},
"MEETING_ORGANIZER": "Alex Johnson"
}
Despite all correct setup steps, the NSE never triggers on macOS (while working fine on iOS).
Can anyone confirm whether UNNotificationServiceExtension is fully supported for remote notifications on macOS, or if additional configuration or entitlement is needed?