Previously, when using AppDelegate, I was able to check the app’s launch options (launchOptions) to determine cases such as:
Location updates (UIApplication.LaunchOptionsKey.location)
Background push notifications (UIApplication.LaunchOptionsKey.remoteNotification)
However, after migrating to the SceneDelegate approach, launchOptions is no longer available — it always returns nil.
In my app, I need to branch the code depending on the launch options, but I can’t find a way to achieve this in the SceneDelegate environment.
👉 Is there a way to access launch options in SceneDelegate, similar to how it worked in AppDelegate?
Or, if that’s no longer possible, what would be the proper alternative approach?
Any guidance would be greatly appreciated.
User Notifications
RSS for tagPush user-facing notifications to the user's device from a server or generate them locally from your app using User Notifications.
Posts under User Notifications tag
153 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi, I'm having this issue that I have have not been able to figure out as I've gone through a checklist and it seems I have everything in place, but im sending my pushToStartTokenUpdates token to a server and im able to test starting a live activity via CURL where it shows my push token going through and even my test payload but after a while I get this issue in my logs where it fails to find a live activity
Push notifications are set up, im sending my token to APN and im even able to start live activities locally.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
User Notifications
ActivityKit
I created new APNS key, when i clicked on download, this is the error am getting:
Download Failed
Auth Key can only be downloaded once. This auth key has already been downloaded.
I dont have any key before and i have not downloaded the key before, it just a new key, i just created.
Please this is affecting the release of our client app, and the client is having negative thought concern our service not knowing it from you guys.
I'm developing an app which will show the driver ETA and rendering the progress bar of the current ETA.
Intuitively the backend server sends the push notification every 3 seconds through firebase cloud message service to APNS so that the device can refresh the dynamic island smoothly.
But the live activity doesn't refresh as frequently as the backend service does.
It should refresh every 3 seconds but it turns out like refresh 30 ~ 60 seconds, sometimes it didn't refresh at all.
any body facing the same?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
APNS
User Notifications
ActivityKit
Docs mention the following about the timestamp field returned by APNs:
"The time, represented in milliseconds since Epoch, at which APNs confirmed the token was no longer valid for the topic. This key is included only when the error in the :status field is 410."
We would like to clarify whether this timestamp is subject to the fuzzy schedule or whether it represent the accurate time of when APNs knew that the token became invalid?
We understand that using 410 for tracking purposes is off label. However we still would like to have the most accurate information in regards to when token became invalid. This will help us debug user issues better in cases when they re-install, uninstall, change permission settings, etc.
I am experiencing an issue with push notifications on my iOS application. The issue is as follows:
On Android devices, push notifications are received immediately without any problems.
On iOS devices, the behavior is inconsistent:
When the app is in the foreground, notifications are received immediately.
When the app is in the background or in recent apps with a significant delay of 5–10 hours, push notifications are not received at all.
This behavior creates a major challenge for us, as timely notifications are critical for our app’s functionality. We have already verified the following points on our side:
Push notification certificates and APNs setup are correct.
Payload and server configurations are valid, as notifications are working fine on Android.
No restrictions from the server-side, since Android users receive notifications instantly.
It seems the issue is specifically related to iOS devices or APNs delivery. Could you please help us identify the cause and provide guidance on how to resolve this?
iOSアプリでNEAppPushSessionを使い、NEAppPushDelegateの通知を受けてCallKitの着信画面を表示する実装をしていますが、以下の問題に直面しています。
8/13
ログにて下記のエラーが頻発しました。
通知の受け取りテストを約120回してその間ずっとこのエラーが出ていました。
エラー 2025-08-14 11:27:06.793073 +0900 nesessionmanager NESMAppPushSession[SimplePushDefaultConfiguration:7B7218F3-94B5-4AE5-9B9E-94E176694D02] failed to report incoming call to CallKit, error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.callkit.networkextension.messagecontrollerhost was invalidated from this process." UserInfo={NSDebugDescription=The connection to service named com.apple.callkit.networkextension.messagecontrollerhost was invalidated from this process.}
このエラーログが頻発した後、callkitの通知画面が表示されなくなりました。
ですがどうやら通知の監視は開始しているようです。
15時間後の8/14
時間をあけたからか、再度通知が来るようになりました。
ですが再度通知の受け取りテストを行った時に同じエラーログが出ました。
再度通知テストを約120回程行ったら、このエラーログが頻発した後、callkitの通知画面が表示されなくなりました。
ですがどうやら今回も通知の監視は開始しているようです。
15時間後の8/15
今日は15時間かけても通知を取得できませんでした。
ですが同じく通知の監視は開始していそうです。
iPhoneの再起動、Xcodeのクリーンアップ、アンインストールして再インストールなどしても通知は来ないままでした。
また、不思議なことに通知が来ない事象が起きた端末以外でも同じように通知を取得することができません。
他の通知は受け取ることができますが独自の通知であるNEAppPushManagerだけ通知を取得することができません。
質問です。
再度通知を出すためには何をすれば良いでしょうか。
この事象は4099エラーを出しすぎたことにより発生する障害なのでしょうか。
4099エラーを出ている原因は何でしょうか。
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
User Notifications
PushKit
CallKit
Push To Talk
Starting Xcode 14, iOS Simulator is able to communicate with APNs in order to register for notification in the sandbox environment. I created a sample test for this.
A dumb iOS application that registers for notifications. It has UITests to automatize the tap on the consent popup (it is not possible to ask for the permission via CLI sadly).
Once the application registers, the AppDelegate method didRegisterForRemoteNotificationsWithDeviceToken is called and the device token is sent to a local server application (node.js).
The test itself creates an iOS 18.6 Simulator with xcrun simctl, builds such app and run the tests through through CLI with xcodebuild.
Running this on my personal Macbook Pro M1 2021 goes well every time, so I wanted to bring it on Github Actions (arm64 macOS machines), in order to test the works on a open source library I'm building (hapns).
Contacting Github support led me to test this on a macOS image running inside a VM inside a Veertu Anka container on my personal Macbook Pro, due to an VM architectural limit suspicion.
The results were the same: iOS simulator isn't able to receive the device token. Not even didFailToRegisterForRemoteNotificationsWithError is called (tested through some network probes-requests that communicate to the server which checkpoints the process reached).
So, as asked, I've setup a repro-case to be run in the VM and I've collected VM diagnostics ready to be tested and attached.
Does anyone know if there is some unspecified (or specified but buried in the documentation) limit for this? Thanks.
Github discussion link for further details, repro-case and so on: https://github.com/actions/runner-images/issues/12747
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
APNS
Xcode
User Notifications
Virtualization
After porting code to Swift 6 (Xcode 16.4), I get a consistent crash (on simulator) when using UNUserNotificationServiceConnection
It seems (searching on the web) that others have met the same issue. Is it a known Swift6 bug ? Or am I misusing UNUserNotification ?
I do not have the crash when compiling on Xcode 26 ß5, which hints at an issue in Xcode 16.4.
Crash log:
Thread 10 Queue : com.apple.usernotifications.UNUserNotificationServiceConnection.call-out (serial)
As far as I can tell, it seems error is when calling
nonisolated func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
I had to declare non isolated to solve a compiler error.
Main actor-isolated instance method 'userNotificationCenter(_:didReceive:withCompletionHandler:)' cannot be used to satisfy nonisolated requirement from protocol 'UNUserNotificationCenterDelegate'
I was advised to:
Add 'nonisolated' to 'userNotificationCenter(_:didReceive:withCompletionHandler:)' to make this instance method not isolated to the actor
I filed a bug report: Aug 10, 2025 at 2:43 PM – FB19519575
Topic:
App & System Services
SubTopic:
Notifications
Tags:
Swift
Xcode
Notification Center
User Notifications
I'm struggling to convert Swift 5 to Swift 6.
As advised in doc, I first turned strict concurrency ON. I got no error.
Then, selected swift6… and problems pop up.
I have a UIViewController with
IBOutlets: eg a TextField.
computed var eg duree
func using UNNotification: func userNotificationCenter
I get the following error in the declaration line of the func userNotificationCenter:
Main actor-isolated instance method 'userNotificationCenter(_:didReceive:withCompletionHandler:)' cannot be used to satisfy nonisolated requirement from protocol 'UNUserNotificationCenterDelegate'
So, I declared the func as non isolated.
This func calls another func func2, which I had also to declare non isolated.
Then I get error on the computed var used in func2
Main actor-isolated property 'duree' can not be referenced from a nonisolated context
So I declared duree as nonsilated(unsafe).
Now comes the tricky part.
The computed var references the IBOutlet dureeField
if dureeField.text == "X"
leading to the error
Main actor-isolated property 'dureeField' can not be referenced from a nonisolated context
So I finally declared the class as mainActor and the textField as nonisolated
@IBOutlet nonisolated(unsafe) weak var dureeField : UITextField!
That silences the error (but declaring unsafe means I get no extra robustness with swift6) just to create a new one when calling dureeField.text:
Main actor-isolated property 'text' can not be referenced from a nonisolated context
Question: how to address properties inside IBOutlets ? I do not see how to declare them non isolated and having to do it on each property of each IBOutlet would be impracticable.
The following did work, but will make code very verbose:
if MainActor.assumeIsolated({dureeField.text == "X"}) {
So I must be missing something.
I have my app configured as a Driving Task app with the entitlement and provisioning profile correctly set up. I am also requesting the ".carPlay" notification authorization option and setting up the carplay notification category with the ".allowInCarPlay" category, both without error.
When testing with the iPhone and carplay simulators the user notifications I send are appearing on the phone but not in carplay.
When I check the notification settings with UNUserNotificationCenter.current().getNotificationSettings() I see that carplay is shown to be not supported ("carPlaySetting: NotSupported").
The CarPlay Developer Guide 2025-06-09 (which is the version currently referenced in the Apple docs) states that "Starting in iOS 18.4, notifications are also supported in CarPlay driving task apps".
Has this discrepancy been addressed anywhere, or is this an open issue?
My software versions:
MacOS: Sequoia 15.6
XCode: 16.4
iPhone Simulator: iPhone 16 with iOS 18.6
I'm integrating Twilio Voice (v6.12.1) into my React Native app (using Swift bridging for iOS) and have implemented full VoIP, PushKit, and CallKit support for incoming calls.
✅ What works:
Incoming calls trigger the VoIP push and display the full-screen CallKit interface (or fallback UI).
Decline Call works as expected.
Call logs and events print correctly.
❌ Problem:
When I try to accept the call using the CallKit Accept button or React Native fallback UI, I consistently get:
❌ [TwilioVoiceModule] answerCall() callInvite is missing.
I also noticed that the console logs for answerCall() are being printed three times in a row, even though the accept button is only pressed once. Additionally in the first time console, answerCall() CallInvite found, accepting...
🔍 Observations:
The callInvite is properly received when the VoIP push arrives.
But when answerCall() is triggered, callInvite becomes nil.
This happens in CallKit accept, RN UI accept, and even notification banner accept.
📦 How it's set up (summarized):
PushKit Registration – via PKPushRegistry in AppDelegate.swift
VoIP push handling – forwards payload to TwilioVoiceModule.handleIncomingPush()
CallKit integration – uses CXProviderDelegate to report and handle accept actions
JS Bridge – emits acceptCallAction to JS
React Native calls TwilioVoiceModule.answerCall(uuid, callSid)
In answerCall() method: self.callInvite is nil – so call cannot be accepted.
Attaching the link to view the relevant code: https://docs.google.com/document/d/15pNjKrfk954OaotpMIEh3xQUtst---1K45DBXoYctGM/edit?usp=sharing
💡 Call Accept Flow (iOS):
VoIP Push → TwilioVoiceModule.handleIncomingPush()
Twilio SDK creates callInvite
reportNewIncomingCall() triggers CallKit UI
On accept: CXAnswerCallAction → emits event to JS
RN calls TwilioVoiceModule.answerCall(uuid, callSid)
Problem: callInvite is already nil
❓ What I'm trying to understand:
Why is callInvite becoming nil before answerCall() is called?
Why are the logs showing the answerCall() call 3 times?
Is there a race condition or multiple accept triggers?
Should I ensure callInvite is accepted only once across all 3 accept paths?
**
💬 Any help would be appreciated.**
📱 Environment:
React Native 0.78.x
iOS 17+
Swift bridging with TwilioVoiceModule.swift
Twilio Voice SDK 6.12.1
PushKit + CallKit + react-native-callkeep
I'm building a light-based(sunrise) alarm iOS app using SwiftUI , the idea is to wake users not with sound, but with a full-screen bright light UI (mimicking sunrise or a light alarm clock).
I'd like to replicate behavior similar to the native Clock app:
My goal:
When the scheduled time is reached, forcefully display a full-screen "light" screen, even if the device is:
locked
running another app
or the app is backgrounded
The problem:
So far, I can:
Show a full-screen AlarmView only if the app is opening
But I cannot:
Automatically wake the screen when app is closed
My confusion:
I've read that Critical Alerts allow bypassing Do Not Disturb and Silent Mode but that's only for sound right?
Can Critical Alerts also help with waking the screen or displaying visuals like full-screen UI automatically?
If not, is there any way to simulate this kind of alarm:
light-based screen effect ( sunrise alarm clock)
triggered automatically at a specific time
without needing the user to manually tap the notification?
Do I need to consider:
PushKit + VoIP?
CallKit (but it's meant for calls)?
Background tasks + silent push?
Or is it simply impossible without special entitlements?
Thanks in advance for any insights. This seems like a simple use case (light-based alarm), but I’m surprised how limited the options is.
We are observing unexpected behavior in Apple Push Notification Service (APNS) delivery and would appreciate clarification and guidance. Below is a detailed
breakdown of the scenario and related questions.
Abbreviations:
APNP – Apple Push Notification Provider
APNS – Apple Push Notification Service
Scenario:
User1 is registered on iOS device1.
Flight Mode is enabled on iOS device1.
User2 initiates a call to User1 (Time t = 0 sec).
User2 cancels the outgoing call after 5 seconds (Time t = 5 sec).
Flight Mode is disabled on iOS device1 after 20 seconds (Time t = 25 sec).
Observation:
iOS device1 displays an incoming call notification (CallKit UI) after flight mode is turned off, despite the call being cancelled by User2.
This notification disappears automatically after approximately 8–10 seconds.
Logic Flow:
At time t = 0, our APNP sends a VoIP push (priority) to APNS for the incoming call.
Since device1 is in flight mode, APNS cannot deliver the push.
At t = 25 sec, after flight mode is turned off, APNS delivers the cached VoIP push to device1.
The app takes ~5 seconds to initialize (CSDK setup, SIP registration, etc.).
It eventually receives a SIP NOTIFY with state="full" and empty dialog info (indicating no active call).
Consequently, the CallKit incoming call is removed after ~8 seconds.
Questions:
→ We set the apns-expiration header to 0, expecting that the VoIP push would not be delivered if the device was unreachable when the push was sent. However, APNS still delivers the push 20–30 seconds later, once the device is back online.
Q. Why is the apns-expiration header not respected in this case?
→ Upon receiving the VoIP push, we require ~10–12 seconds to determine if a visible CallKit notification is still relevant (e.g., by completing SIP registration and checking for active dialogs).
Q. Is it acceptable, per Apple guidelines, to intentionally delay showing the CallKit UI (incoming call) for 10–15 seconds after receiving the VoIP push?
→ Apple documentation states that the priority VoIP push channel should be used only for notifying incoming calls, while regular (non-VoIP) pushes should be used for other updates, including call cancellations.
Q. What is the rationale behind discouraging the use of the priority VoIP push channel for call cancellation events? In some cases, immediate cancellation notification is as critical as the initial incoming call. Would Apple consider it acceptable to occasionally use the priority VoIP channel for rare call-cancellation scenarios without risking throttling or suspension?
→ In our implementation, we send an incoming call notification via the priority VoIP channel. Shortly after, we send a call cancellation notification on the regular push channel, marked with "content-available": 1. We expect this regular push to wake the app (triggering application:didReceiveRemoteNotification:fetchCompletionHandler:), but in practice the app never wakes, and our debug logs inside that delegate method never appear.
Q. Under what exact conditions does a "content-available": 1 regular push fail to wake the app when it follows a VoIP push? Are there additional requirements (e.g., background modes, rate limits, power optimizations) that could prevent the delegate from being called?
→ According to Apple documentation: “APNs stores only one notification per bundle ID. When multiple notifications are sent to the same device for the same bundle ID, APNs keeps only the latest one.” However, in our tests: If a device is offline when APNs receives both: (a) a priority VoIP push for an incoming call, (b) a regular push for call cancellation (same bundle ID), Upon the device reconnecting, APNs still delivers the earlier VoIP push, instead of discarding it and delivering only the most recent (cancellation) notification.
Q. Why doesn’t APNs replace the queued VoIP push with the newer regular push when both share the same bundle ID? Is this expected behavior due to channel type differences (VoIP vs. regular), or is there a way to ensure that the latest notification (even if regular) supersedes the earlier VoIP push?
We’d appreciate your input or recommendations on handling such delayed pushes and any best practices for VoIP push expiration handling and call UI timing.
Observations:
When our app calls the APNs API for push notifications, we observed significant fluctuations:
July 15-25: The success response volume increased by 20% compared to the baseline before July 15.
After July 25: Success rates returned to baseline levels.
July 30: Success response volume decreased by 10% compared to the pre-July 15 baseline.
Excluded Factors:
No changes in target audience size or characteristics (business factors ruled out).
Server logs confirm consistent API request parameters and frequency.
Key Questions:
Were there any adjustments to response metrics (e.g., success status code definitions) during this period?
Have other developers reported similar issues?
Were there server-side configuration updates or known incidents on Apple’s end?
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
App Store Server Notifications
User Notifications
I created an app. One if its functionalities is receive Remote Notification in the background, while app is monitoring Significant Location Changes (SLC). This functionality worked fine. I was receiving these notifications correctly. Sometimes instantly, sometime with small or large delay.
And then I send the app for review. It was rejected with 3 remarks:
The app or metadata includes information about third-party platforms that may not be relevant for App Store users, who are focused on experiences offered by the app itself (I wrote that app communication works both for iOS and Android.)
The app declares support for audio in the UIBackgroundModes key in your Info.plist but we are unable to locate any features that require persistent audio.
EULA (End User License Agreement) is missing for in-app purchases.
After the rejection the app is no longer receiving these notifications. They are there, since the app receives them, when I open app, or significant location change is detected. It also works, when I run the app directly from Xcode (in debug mode), not from TestFlight nor in Sandbox.
It seem to me like Apple somehow spoiled my background capabilities on purpose or accidentally. Is it possible? What can I do with it? Is it the case that I should just fix the review remarks and send the app back to review, and once the app passes it, it will work again? Or should I not count on it? Any suggestions? I asked Apple using:
https://developer.apple.com/contact/topic/#!/topic/select
but so far no response.
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Review
User Notifications
Background Tasks
Maps and Location
Since upgrading to Xcode 26 beta 4 and using the iOS 26 simulator for testing our app, we've stopped being able to receive device tokens for the simulator from the development APNS environment.
The APNS environment is able to return meta device information (e.g. model, type, manufacturer) but there are no device tokens present. When running the same app using the iOS 18.5 simulator, we are able to register the device with the same APNS environment and receive a valid device token.
Hi All,
im working on a project to send a push notification in CarPlay.
Current accepted by apple entitlements is driving.
Are custom actions / buttons allowed/supported in CarPlay notifications?
Topic:
App & System Services
SubTopic:
Notifications
Tags:
CarPlay
Notification Center
User Notifications
After upgrading to iOS 26 Public Beta 23A5297M, none of my notifications are working even though the volume is turned up and notifications are enabled.
Why is this happening?
Two months ago we got approval for using the Notification Filtering entitlement. We rushed out to implement it in our app, only to find out that the permission was set for the wrong bundle identifier.
We expected to get the permission for the notification extension's bundle identifier, yet it is added for the main app's bundle identifier.
Per the official docs, the entitlement permission should be in the notification service extension target:
After you receive permission to use the entitlement, add com.apple.developer.usernotifications.filtering to the entitlements file in the Notification Service Extension target.
However, this fails to get signed when compiling for non-simulator targets because of the bundle mismatch issue. Simulator perfectly filters notifications.
Adding the entitlement to the main app does compile, but filtering does not work (as expected).
We reached out to Apple twice (Case-ID: 14330583) but we have yet to receive any response.
Could there be something else wrong instead of the identifier mismatch?
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
Entitlements
Code Signing
App ID
User Notifications