My Mac app has a launch agent (within the app bundle) that works great without the app running. There are some occasions where I need to display an alert and ask the user to launch the app to handle the issue. I thought about using UNUserNotificationCenter but I'm not able to make it work from the agent.
I'm asking for authorization as follows:
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge)
completionHandler:^(BOOL granted, NSError * _Nullable error) {
NSLog(@"authorization request completion. Granted: %@, error: %@ (%@)",granted?@"YES":@"NO",error, [error localizedDescription]);
}];
And I'm trying to post the notification as follows:
content.title = @"Your App Name";
content.body = @"Click the button to open the app";
content.sound = [UNNotificationSound defaultSound];
UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:[[NSUUID UUID] UUIDString]
content:content
trigger:nil];
[center addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error showing notification: %@ %@", error, [error localizedDescription]);
}
}];
When running I'm getting asked to authorize, I authorize and all seems OK in system settings but I'm not able send any notifications. addNotificationRequest results in UNErrorCodeNotificationsNotAllowed error.
I tried this with the authorization request inside the main app, or inside the agent, with the same results.
When trying to post the notification from within the app, it does work, but that's not what I need.
Is posting notifications from within the launch agent not possible at all, or is there anything here that I'm missing.
TIA
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
Activity
We have a case when we send 8 push notifications more or less simultaneously over 1 HTTP 2.0 connection. Using .NET Core 8
Sometimes some of them fail with a strange message:
System.Net.Http.HttpRequestException: The response ended prematurely while waiting for the next frame from the server. (ResponseEnded)
---> System.Net.Http.HttpIOException: The response ended prematurely while waiting for the next frame from the server. (ResponseEnded)
at System.Net.Http.Http2Connection.ThrowRequestAborted(Exception innerException)
at System.Net.Http.Http2Connection.Http2Stream.TryEnsureHeaders()
at System.Net.Http.Http2Connection.Http2Stream.ReadResponseHeadersAsync(CancellationToken cancellationToken)
at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.HttpClientLoggerHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
We noticed that failure is always accompanied with a huge delay (~500ms) comparing to success (~20ms).
Also some of the burst messages are sent successfully (sometimes 2-4 of them)
What can we do about it?
We are developing a messaging app which sends End-to-End encrypted data. The application supports multiple types of E2EE data, including text messages and voice over IP calls. Apple's article titled “Sending End-to-End Encrypted VoIP calls” (https://developer.apple.com/documentation/callkit/sending-end-to-end-encrypted-voip-calls) states that the following steps are required to support E2EE VoIP calls:
Request permission to receive remote notifications through the User Notifications framework
Register for VoIP calls using PuskKit
Add a Notification Service Extension target to your app.
Add the com.apple.developer.usernotifications.filtering entitlement to the NSE target’s entitlements file.
We have completed steps one through three. We are still missing the filtering entitlement. As of right now the system does not allow us to use reportNewIncomingVoIPPushPayload(_:completion:) method because of the missing entitlement.
Below is a short description of how our messaging app works:
User sends a message to another user.
The message is encrypted on device and sent to our server.
The server receives the message and sends a notification request to APNs if needed. The server cannot decrypt the message. As an additional security feature we do not pass the encrypted message in the notification payload. The notification payload only contains a localizable generic placeholder message string and default sound in the ‘aps’ dictionary part.
Upon receiving a notification from our server, the NSE makes a request to our server and fetches the latest messages (encryption keys have already been exchanged between the participants of the conversation) and determines what to do next (display a banner, or pass a call to CallKit).
E2EE VoIP calls are a core feature of our app, so it is imperative that we receive the filtering entitlement.
Our capability request has been rejected twice now. The latest request was rejected because:
Support for VoIP calls should be provided by PushKit. For more information, please consult the documentation page "Responding to Notifications from PushKit".
We cannot support VoIP calls by solely relying on PushKit. Our server cannot make a distinction when to use ‘voip’ (call) and ‘alert’ (text message) apns-push-types. Therefore, the application must be able to use reportNewIncomingVoIPPushPayload(_:completion:) function, where com.apple.developer.usernotifications.filtering entitlement is needed.
We have sent the above text to support two weeks ago and made yet another request.
Has anyone been able to get the capability as of late? What are the magic words that need to be included in the capability request? Can someone here help us? We made the first request on 3rd of September so this process has taken two months. Our planned release date is coming up and the absence of the capability is holding us back. We already have a released desktop and Android versions so changing the server implementation is really not an option.
The APP was not awakened by system after start a liveactivity and the liveactivity has showed on lock screen.so the updatetoken wont send to our inner server and the liveactivity can not update,often like this,but sometimes it can work.
it makes me confuse,and i don't know how should i can do,because the liveactivity like a black box,i can not analyse the data link.for example ,inner server send a start liveactivity,but it can not accept a updatetoken unless the user lanuch APP.
i hope the liveactivity can start and update on background. And i have developed it as described in the document.
Hope to get your help,thank you very much.
Hi,
We received the following message.
Hello, We’re reaching out with a final reminder that the Certification Authority (CA) for Apple Push Notification service (APNs) is changing. APNs updated the server certificates in sandbox on January 21, 2025. APNs production server certificates will be updated on February 24, 2025. To continue using APNs without interruption, you’ll need to update your application’s Trust Store to include the new server certificate: SHA-2 Root: USERTrust RSA Certification Authority certificate.
Note, that we are using Firebase to deliver push notifications and the connection is done via APN keys, not certificates.
Is there anything that we need to update in the application to mitigate the risk of not delivered push notes ?
We are developing a walkie-talkie style iOS app using CallKit and PushKit for real-time voice communication. The app is intended for internal company use and requires unrestricted VoIP push capabilities to reliably deliver incoming call alerts, even in background or locked states.
Our app's use case follows Apple’s guidelines, and we are not using PushKit for messaging or background data. We have already enabled "Push Notifications" in Capabilities and confirmed the provisioning profile, but are unable to enable com.apple.developer.pushkit.unrestricted-voip.
Could someone from Apple or the community advise on the current process to request this entitlement for a production app?
Developer Team ID: 3KX7Q4LX88
App Bundle ID: com.ksc-sys.rcc.TakumiTalk
Developer Name: KOHEI TAKAOKA
Company: R C C, Y.K
Topic:
App & System Services
SubTopic:
Notifications
AlarmKit custom sounds are universally broken in iOS 26.0 stable - instead of playing your custom sound, it plays a system error/timeout beep.
I've spent days investigating why custom sounds result in what sounds like an error beep (like when you cancel an operation or hit a timeout) instead of the actual audio file. I can now prove this is an Apple bug, not implementation error.
Evidence:
Test 1: My Implementation
Followed Apple's documentation exactly
Tried both bundle and Library/Sounds (as documented)
Result: System error beep (not my audio)
Test 2: Professional Apps
Tested ADHDAlarms (popular AlarmKit example by jacobsapps) https://github.com/jacobsapps/ADHDAlarms
Their airhorn.mp3 custom sound: same error beep (not an airhorn)
Their default sound: works perfectly
Test 3: Device Testing
Physical iPhone (iOS 26.0 - 23A341): broken
iOS Simulator: broken
Not device-specific
Files are found correctly, but the actual audio file is never played. Instead, you hear what sounds like a system error/cancellation tone.
What I've Eliminated
Not a Library/Sounds vs Bundle issue (both broken)
Not a file format issue (.mp3, .caf, .m4a all broken)
Not an implementation issue (professional apps broken too)
Not a device issue (simulator and device both broken)
Not a file size issue (5KB to 2MB all broken)
The Documentation Lie:
Apple's docs for AlertConfiguration.AlertSound.named(_:) state:
"Choose a file that's in your app's main bundle or the Library/Sounds folder"
https://developer.apple.com/documentation/activitykit/alertconfiguration/alertsound/named(_:)
Both locations are broken.
Tested on: iOS 26.0 (23A341), Xcode 26.0.1, Swift 6.2
Impact:
This affects any app trying to:
Provide personalized wake-up sounds
Use custom alarm tones
Create meditation/sleep apps
Differentiate from default iOS alarms
Current Status:
Multiple bug reports filed: FB19900024, FB18237648, FB19779004
Apple engineer claimed "fixed in latest beta" in August
Still broken in iOS 26.0 stable (September)
Workaround:
None that I know of. You must use .default sound.
For apps needing custom audio, play it with AVAudioPlayer after the alarm fires and user opens the app.
Question:
Has ANYONE gotten custom AlarmKit sounds working in iOS 26.0 stable? If so, plzzz help I'd be so grateful.
In the app we are developing, we update the device token upon app launch using didRegisterForRemoteNotificationsWithDeviceToken. Previously, after an iOS major update, if the app was left without being launched, users experienced an issue where notifications would not be received. Later, we confirmed that running didRegisterForRemoteNotificationsWithDeviceToken during app launch updates the device token and restores the ability to receive notifications.
Therefore, we believe that the device token may change due to an iOS major update. We want to understand the detailed conditions under which the device token is updated due to an iOS update:
Does the same issue occur after iOS minor updates as well?
Does it always happen during iOS major updates?
We reviewed the official documentation, but there was no detailed description of the device token update conditions. Additionally, we contacted Apple, but received no clear answers. If anyone has experienced the same situation, we would appreciate any information you can share.
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
Notification Center
User Notifications
Hello! I'm currently trying to add local push notifications to my iOS app (React Native + Expo). Most of the guides and documentation I found online revolve around remote notification capabilities and APNS - I don't need this. The app will register a background task to periodically check if it should trigger a notification, fully local. I'm running into issues when adding the push notification capabilities, saying I need a new provisioning profile and to modify the App ID, which prompts me to set up certificates to communicate with APNS - which I don't need.
So I was wondering: Is it possible to build an app without the remote notification setup that can still trigger local notifications? Or is it kind of all-or-nothing, and I need to set up remote notifications as well even if I only need to trigger them locally?
Couldn't really find much online about this, and before I invalidate my current certificates and go through a bunch of redundant setup, I thought I'd ask here.
Help would be greatly appreciated! Thank you!
Topic:
App & System Services
SubTopic:
Notifications
In the new AlarmKit API, how do you localize NSAlarmKitUsageDescription?
In the case of other usage descriptions, such as NSLocationWhenInUseUsageDescription, you can use an InfoPlist.xcstrings file, but this does not appear to work for NSAlarmKitUsageDescription.
Topic:
App & System Services
SubTopic:
Notifications
Hello Team,
We are currently experiencing an issue where some of our devices are not receiving push notifications. We are sending notifications via the Apple Push Notification portal (https://developer.apple.com/notifications/push-notifications-console/) using the following two requests. However, in both cases, the notifications are not being delivered to the devices.
Scenario 1 :
When we send a request with apns-push-type set to alert, we receive the following error.
Request :
curl -v
--header "authorization: bearer ${AUTHENTICATION_TOKEN}"
--header "apns-topic: com.testcompany.sampletest"
--header "apns-push-type: alert"
--header "apns-priority: 10"
--header "apns-expiration: 0"
--data '{"aps":{"alert":{"title":"Test Notification Title","subtitle":"Test Notification Sub Title","body":"Test Notification Body"}}}'
--http2 https://api.push.apple.com:443/3/device/*devicetoken*
Response:
{
"code": 400,
"message": "bad-request",
"reason": "The device token is inactive for the specified topic. There is no need to send further pushes to the same device token, unless your application retrieves the same device token.",
"requestUuid": "c4ae39b4-87e1-4269-a1e9-163f60ec0385"
}
Scenario 2 :
However, if we send the request with apns-push-type set to background, the request is processed successfully by APNs, but no notification is received on the device.
Request :
curl -v
--header "authorization: bearer ${AUTHENTICATION_TOKEN}"
--header "apns-topic: com.testcompany.sampletest"
--header "apns-push-type: background"
--header "apns-priority: 10"
--header "apns-expiration: 0"
--data '{"aps":{"alert":{"title":"Test Notification Title","subtitle":"Test Notification Sub Title","body":"Test Notification Body"}}}'
--http2 https://api.push.apple.com:443/3/device/*devicetoken*
Response:
Getting a message that The notification sent successfully but no notification is received on the device.
In both cases (with alert and background push types), the push notification does not reach the device.
Additionally, when we validated the device token using the APNs Device Token Validator, it appears to be valid and returns the following message.
"Device Token is valid for sending Alert & Background push-type notifications in the Production environment"
Affected Device:
macOS version : MacOS 15.3.1
Processor : Apple M1
Could you please assist me in resolving this issue?
Thanks
Hello Apple Developer Team,
Based on the mandate to update the APNs certificate by February 24, 2025 for certificate-based authentication, a question from the team has been brought up that maybe Apple or the community can help answer. Since our implementation uses token-based authentication, I’m seeking clarification on a couple of points:
1. Does the certificate update affect token-based connections at all?
2. What is the rationale behind updating certificates for certificate-based authentication, and are there any implications or benefits for developers using token-based authentication?
Understanding these details will help us ensure our system remains compliant and optimally configured. Any guidance or further clarification you can provide would be greatly appreciated.
Thank you!
Excited for AlarmKit! I have found two concerns that I cannot find answers for though.
The volume of my alarms seems to be very quite relative to the full volume capability of the device. For example, if I turn the volume all the way up and play the audio file, the sound is very loud. However then, if I set the alarm using alarm kit with the same audio, the track played during the alerting phase is not that loud. I am afraid that it will not be loud enough in real life. Will there be future support to set the volume level of the alarm to maximum settings?
When I press the volume buttons (with the app open) during an active alarm, the audio stops, but the alarm manager does not clear these events. The alarm manager does clear the alarm event if the alarm is stopped through a live activity.
Topic:
App & System Services
SubTopic:
Notifications
In iOS 26, I can check the notification that arrives to the user when the AirPods or Apple Watch is fully charged. When tap the notification, notification only expands and does not include actions such as moving to an app.
I checked the documents of UserNotification and UNNotificationServiceExtension, but I couldn't find what I wanted.
I can expand by long-tapping as default, but I'm looking for a way to expand it without entering the app when I tap the notification.
I wonder if there is an API that I missed or if it's not publicly supported.
thank you for your support.
We operate a social network application, SportsYou with over 3 million monthly active users and are experiencing significant issues with push notification delivery through APNs.
We have a large number of users reporting they are not receiving push notifications. Our infrastructure uses AWS SNS integrated with APNs to deliver notifications. However, AWS CloudWatch consistently reports successful delivery (Success response), even though users confirm they never received the notifications.
Because we receive success responses from AWS SNS, our system does not attempt to recreate or refresh the device endpoints. This leaves us unable to detect or recover from these delivery failures automatically.
This issue is widespread and inconsistent. It affects users across multiple variables including different iOS versions, different device models, and different versions of our application. We cannot identify a clear pattern that would help us isolate the root cause.
With millions of active users, even a small percentage of delivery failures represents thousands of users experiencing a degraded service. This is significantly impacting user engagement and satisfaction.
We need guidance on how to properly diagnose this issue and ensure reliable notification delivery to our users. Specifically, we'd like to understand why we're receiving success responses when notifications aren't being delivered, and what steps we can take to detect and prevent these failures.
As you announced at this link https://developer.apple.com/forums/thread/766788, 'APNs will update the server certificates in sandbox on January 20, 2025, and in production on February 24, 2025.' I guess you have updated the sandbox certificate. What can we do to test whether we have correctly updated our application’s Trust Store to include the new server certificate.We test on a server that haven't updated the new server certificate, connect your sandbox environment 'api.sandbox.push.apple.com' to send notifications, it succeed. As I guess, it should failed.
Hello, I'm using 'App Store Server Notifications V2'.
I have a question about 'CONSUMPTION_REQUEST' notification in 'notificationType'.
I was wondering if there would be any impact on refunds if I received this notification and didn't respond. (Always refund etc..)
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Store
In-App Purchase
App Store Server Notifications
I have an app that pairs with a wearable Bluetooth device that collects users' health data. My web backend sends two push notifications every hour to all app users—one at XX:05 and another at XX:15. The first notification instructs the app to download data from the paired wearable device, while the second prompts the app to upload the downloaded data to the backend server's database.
However, I’ve noticed that many push notifications are not processed by iOS apps, especially at night. Based on Apple's documentation, iOS prioritizes push notifications and may ignore lower-priority ones to conserve battery life.
Is there a way to increase the priority to ensure that more (or all) push notifications are processed?
Would integrating the HealthKit framework help? Currently, I use Firebase Cloud Messaging (FCM) to send push notifications. Additionally, my app falls under the Health & Fitness category. Would changing it to Medical increase priority? P.S. I understand that Apple requires certain certifications for an app to be classified as Medical.
Topic:
App & System Services
SubTopic:
Notifications
I am unable to connect to APNs sandbox push endpoint from our backend servers. It works fine when hitting the request from my local machine but it fails from the infra servers. Here are the complete curl details.
Endpoint: https://api.sandbox.push.apple.com:443 CURL request and response:
curl -v https://api.sandbox.push.apple.com:443
Trying 17.188.168.149:443...
Connected to api.sandbox.push.apple.com (17.188.168.149) port 443
ALPN: curl offers h2,http/1.1
Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
TLSv1.2 (OUT), TLS handshake, Client hello (1):
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.sandbox.push.apple.com:443
Closing connection
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.sandbox.push.apple.com:443
There are no issues with Production endpoint. Can someone help? Verified all certificates. Everything worked fine until 29th July but started failing since 30th July
Here is the PCAP file. Additionally, Here is the outbound public IP : 3.251.214.255
apple_push_sandbox_pcap.txt
Hello, I am trying to utilize the Critical Messaging API to allow my user to message 1 or multiple pre registered contacts automatically.
An issue I am having with this in testing is that when the application attempts to fire off texts to the phone numbers the success rate changes from trial to trial, with no variable changing. Sometimes I can send a Critical Message to multiple phone numbers in rapid succession, sometimes the message is only sent to 1 contact, and sometimes I get no successes. Each failure always returns the MSCriticalMessaging.notSupported error.
The API documentation states, "The send(_:to:) method only works if the app is backgrounded, if it’s called from foreground the framework returns a MSCriticalMessagingError.notSupported error."
If my app is always backgrounded in these tests, what other issues may cause this notSupported error return, and why does the outcomes success rate vary?