Notifications

RSS for tag

Learn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.

Notifications Documentation

Posts under Notifications subtopic

Post

Replies

Boosts

Views

Activity

Issue with app not waking up intermittently due to Pushkit (VOIP)
I am developing a VoIP service. Usually, when receiving a VoIP Push, Callkit is exposed immediately after receiving the message and the app is designed to be used. However, there is an extremely intermittent phenomenon (not well reproduced) where the app does not wake up even when receiving a VoIP Push. And after a long time, the app wakes up and Callkit is activated. (A long time after receiving the call…) Has anyone experienced the above phenomenon? I wonder if there are any reported parts depending on the OS version. (I have identified that it does not occur in the 17.x version, but it is difficult to guarantee because it occurs extremely intermittently) The app is not running in the background, but... Could this be happening if there are a lot of pending operations in the background? I need help urgently
5
0
494
3d
iOS doesn't handle incoming call of Local PUSH when receiving a Local PUSH after receiving an APNs PUSH
I am developing an application that uses NetworkExtension (Local PUSH function) And VoIP(APNs) PUSH. Nowadays, I found a problem on this app doesn't handle incoming call of Local PUSH when receiving a Local PUSH after receiving an APNs PUSH. My confimation result of my app and server log is below. 11:00 AM: my server(PBX) requests a VoIP(APNs) PUSH notification to the APNs. But my app does not receive the VoIP(APNs) PUSH. At this time, my app is running on LAN (Wi-Fi without internet connection), as a result, NetworkExtension was running. so I think this is normal behaviour. 14:55:11 PM: There is an incoming call from the my server(PBX) via local net, and NetworkExtension calls iOS API(API name is reportIncomingCall). However, iOS does not call the delegate didReceiveIncomingCallWithUserInfo for the reportIncomingCall. 14:55:11 PM: At almost the same time, iOS calls the delegate cdidReceiveIncomingPushWithPayload of VoIP PUSH. (instead of call the delegate didReceiveIncomingCallWithUserInfo for the reportIncomingCall?) And the content of this VoIP(APNs) PUSH was the incoming call at "11:00 AM". In other words, the VoIP(APNs) PUSH at 11:00 AM is stuck inside iOS, and at 14:55:11 PM, from NetworkExtension reports it. I feel there is a problem on iOS doesn't handle incoming call of Local PUSH when receiving a Local PUSH after receiving an VoIP(APNs) PUSH. Would you tell me Apple's opioion about this? If this is known problem, Please tell me about it.
7
0
920
3d
Issue related to APNS is delivering expired voip push notification.
Hi, am facing an issue related to voip push notifications getting delivered 1-2 hours after apns-expiration to 0 and apns-priority to 10. I had raised a similar post got a reply that it may be due to network delay. But network delay can cause the delivery of voip push to be delayed only by few seconds or minutes. But in our case voip push is getting delivered hours after the voip call was attempted. Steps to reproduce: Put our voip app in background and lock iPhone. As app is put in background, socket connections gets disconnected from server. Now if a caller makes call to this app, the call should be delivered through voip push. 2) Voip push should ideally be received even if app is in background and iPhone is locked. It is connected to a good wifi network. But it does not receive the voip push. 3) After 1-2 hours user unlocks iPhone and opens voip app. As soon as user opens app, the voip push is received and phone starts ringing.
5
0
238
3d
Delivery of expired voip notifications
Hello, We are facing issue that sometimes a voip notification gets delivered after it is expired. The issue can be simply demonstrated we set the device to flight mode, and after 20s we disable flight mode. We still receive the voip notification. We are setting the expiration header as following apns-expiry=0, so from my understanding it should not be delivered if the device was not able to receive the notification in the fist attempt. I have read following thread https://developer.apple.com/forums/thread/778512, from which I understand this is a long standing issue. Hence my question is, is there any way how we can notify the call kit that the call is actually no longer valid, and do not display the call to the user at all? Currently we are forced to always display CallKit call when the notification comes, and some of our users are confused that they see a missed call which they did not have any chance to pick up. Please let me know if you need any more information. Best Regards, Adam Chlupacek
2
0
125
3d
didRegisterForRemoteNotificationsWithDeviceToken called twice when also using CKSyncEngine in project
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") }
4
0
208
6d
Notification Sound Not Routing to Bluetooth / External Speakers Consistently
Hello Apple Developer Support, We are observing inconsistent behavior with push notification sounds routing to Bluetooth / external speakers. Our app sends push notifications with a custom sound file using the sound parameter in the APNs payload. When an iPhone is connected to a Bluetooth speaker or headphones: On some devices, the notification sound plays through the connected Bluetooth/external speaker. On other devices, the notification sound plays only through the iPhone’s built-in speaker. We also tested with native apps like iMessage and noticed similar behavior — in some cases, notification sounds still play through the phone speaker even when Bluetooth is connected. Media playback (e.g., YouTube or Music) routes correctly to Bluetooth, so the connection itself is functioning properly. We would like clarification on the following: Is this routing behavior expected for push notification sounds? Are notification sounds intentionally restricted from routing to Bluetooth in certain conditions (e.g., device locked, system policy, audio session state)? Is there any supported way to ensure notification sounds consistently route through connected Bluetooth/external speakers? The inconsistent behavior across devices makes it difficult to determine whether this is by design or a configuration issue. Thank you for your guidance.
1
0
93
6d
Time-Sensitive Trip Offer UI (Lock Screen + Persistent Until Action) – iOS 14 Best Practice?
Hello, I am developing a driver-based application targeting iOS 14+, where users receive time-sensitive trip offers (approximately 10–15 seconds to respond). We would like to implement behavior similar to approval-based apps (e.g., MyGate-style interaction), with the following requirements: When the device is locked: A highly visible notification that allows quick Accept / Decline action. When the device is unlocked (foreground or background): A notification that remains prominently visible (sticky-style) at the top of the screen until the user takes action (Accept / Decline) or the offer expires. Our goal is to ensure the offer remains noticeable and actionable within the short response window. I would appreciate clarification on the following: On iOS 14, is there any supported mechanism to present a true full-screen blocking interface while the device is locked (without using CallKit or Critical Alerts entitlement)? Is there a supported way to make a notification persistent or non-dismissible until the user takes action or the offer expires? Are there any App Review concerns with presenting a blocking modal immediately after the user interacts with a notification? We want to ensure full compliance with Apple’s platform guidelines and avoid unsupported or discouraged patterns. Thank you for your guidance.
1
0
78
6d
Notifications scheduled but never delivered at scheduled time
Device: iPhone (real device) iOS: 17.x Permission: Granted Notifications are scheduled using UNCalendarNotificationTrigger. The function runs and prints "SCHEDULING STARTED". However, notifications never appear at 8:00 AM, even the next day. Here is my DailyNotifications file code: import Foundation import UserNotifications enum DailyNotifications { // CHANGE THESE TWO FOR TESTING / PRODUCTION // For testing set to a few minutes ahead static let hour: Int = 8 static let minute: Int = 0 // For production use: // static let hour: Int = 9 // static let minute: Int = 0 static let daysToSchedule: Int = 30 private static let idPrefix = "daily-thought-" private static let categoryId = "DAILY_THOUGHT" // MARK: - Permission static func requestPermission(completion: @escaping (Bool) -> Void) { let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound]) { granted, _ in DispatchQueue.main.async { completion(granted) } } } // MARK: - Schedule static func scheduleNext30Days(isPro: Bool) { print("SCHEDULING STARTED") let center = UNUserNotificationCenter.current() center.getNotificationSettings { settings in guard settings.authorizationStatus == .authorized else { requestPermission { granted in if granted { scheduleNext30Days(isPro: isPro) } } return } // Remove old scheduled notifications center.getPendingNotificationRequests { pending in let idsToRemove = pending .map { $0.identifier } .filter { $0.hasPrefix(idPrefix) } center.removePendingNotificationRequests(withIdentifiers: idsToRemove) let calendar = Calendar.current let now = Date() for offset in 0..<daysToSchedule { guard let date = calendar.date(byAdding: .day, value: offset, to: now) else { continue } var comps = calendar.dateComponents([.year, .month, .day], from: date) comps.hour = hour comps.minute = minute guard let scheduleDate = calendar.date(from: comps) else { continue } if scheduleDate <= now { continue } let content = UNMutableNotificationContent() content.title = "Just One Thought" content.sound = .default content.categoryIdentifier = categoryId if isPro { content.body = thoughtForDate(scheduleDate) } else { content.body = "Your new thought is ready. Go Pro to reveal it." } let triggerComps = calendar.dateComponents( [.year, .month, .day, .hour, .minute], from: scheduleDate ) let trigger = UNCalendarNotificationTrigger( dateMatching: triggerComps, repeats: false ) let identifier = idPrefix + isoDay(scheduleDate) let request = UNNotificationRequest( identifier: identifier, content: content, trigger: trigger ) center.add(request) } } } } // MARK: - Cancel static func cancelAllScheduledDailyThoughts() { let center = UNUserNotificationCenter.current() center.getPendingNotificationRequests { pending in let idsToRemove = pending .map { $0.identifier } .filter { $0.hasPrefix(idPrefix) } center.removePendingNotificationRequests(withIdentifiers: idsToRemove) } } // MARK: - Helpers private static func isoDay(_ date: Date) -> String { let formatter = DateFormatter() formatter.locale = Locale(identifier: "en_US_POSIX") formatter.dateFormat = "yyyy-MM-dd" return formatter.string(from: date) } private static func thoughtForDate(_ date: Date) -> String { guard let url = Bundle.main.url(forResource: "thoughts", withExtension: "json"), let data = try? Data(contentsOf: url), let quotes = try? JSONDecoder().decode([String].self, from: data), !quotes.isEmpty else { return "Stay steady. Your growth is happening." } let calendar = Calendar.current let comps = calendar.dateComponents([.year, .month, .day], from: date) let seed = (comps.year ?? 0) * 10000 + (comps.month ?? 0) * 100 + (comps.day ?? 0) let index = abs(seed) % quotes.count return quotes[index] } } Then here is my Justonethoughtapp code: import SwiftUI import UserNotifications @main struct JustOneThoughtApp: App { @StateObject private var thoughtStore = ThoughtStore() // MUST match App Store Connect EXACTLY @StateObject private var subManager = SubscriptionManager(productIDs: ["Justonethought.monthly"]) var body: some Scene { WindowGroup { ContentView() .environmentObject(thoughtStore) .environmentObject(subManager) .onAppear { // Ask for notification permission NotificationManager.shared.requestPermission() // Schedule notifications using PRO status DailyNotifications.scheduleNext30Days( isPro: subManager.isPro ) } } } } final class NotificationManager { static let shared = NotificationManager() private init() {} func requestPermission() { UNUserNotificationCenter.current().requestAuthorization( options: [.alert, .sound, .badge] ) { _, _ in } } }
1
0
75
1w
APNS always returning "discarded as device was offline"
Approx Dec 13th 2025 til now (Dec 29th) I noticed my APNS dropped off to nothing daily. When I try to send APNS alerts on the developer site tool it always returns "discarded as device was offline" for multiple devices which I know are online. When I try pushing through my VPS (as I always have without any code changes for months) I get status codes of 400 and 403 mostly and a few 200's without it delivering also. I created a new sandbox certificate just in case it was that but still no luck, I get the same results. Ive checked for any firewall issues and I see the following on my VPS: nslookup gateway.push.apple.com Server: 1.1.1.1 Address: 1.1.1.1#53 ** server can't find gateway.push.apple.com: NXDOMAIN This seems like a second issue but not the primary issue that the portal is reporting. Any ideas what to check? Im at a loss as to why its not working at all through apples test notification portal on my developer account. It seems thats the initial issue I need to solve. Thank you for any ideas/help
5
0
253
1w
UNLocationNotificationTrigger not firing reliably in China – possible coordinate system mismatch
Problem Description Location-based notifications added with UNLocationNotificationTrigger and CLCircularRegion do not fire consistently when the user enters the monitored region. Sometimes they work, sometimes they do not. In tests where the user physically enters the region and waits several days, the notification often never triggers. What we’ve confirmed Notification permission is granted Location permission is set to “Always” The notification request is successfully added (no error from UNUserNotificationCenter.add) Pending notification requests are present when checked with getPendingNotificationRequests CLLocationManager didEnterRegion / didExitRegion work when we monitor the same region via startMonitoring(for:) UNLocationNotificationTrigger behavior is inconsistent and unreliable in our tests Reproduction Steps Launch the app and grant notification permission and “Always” location permission Add a region notification (either by current GPS location or by selecting a point from MKLocalSearch) Leave the monitored region Later, physically return into the region Expected: a notification is delivered when entering the region Actual: the notification often does not appear, even after waiting days Our Hypothesis: Coordinate System Mismatch in China We suspect the issue may be related to coordinate systems in mainland China. In China, Apple MapKit and MKLocalSearch use GCJ-02 (the “Mars” coordinate system required by local regulations). Device GPS and CLCircularRegion / Core Location use WGS-84. If an app supplies GCJ-02 coordinates to CLCircularRegion (e.g. from MapKit or search), the region center may be offset by hundreds of meters from the actual WGS-84 position. That could make the system’s “inside region” check fail, even when the user is physically inside the intended area. Questions for Apple Does CLCircularRegion (and therefore UNLocationNotificationTrigger) expect coordinates in WGS-84? If so, should apps in China convert GCJ-02 to WGS-84 before passing coordinates to CLCircularRegion? Is there any official guidance or documentation for handling coordinate systems when using location-based notifications in mainland China? Are there known limitations or special requirements for UNLocationNotificationTrigger in China (e.g. coordinate system, accuracy, or system behavior) that could explain intermittent or missing triggers?
0
1
88
2w
AlarmKit Volume and Volume Buttons
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.
3
2
385
3w
Unknown APNs ERROR: BadEnvironmentKeyInToken when sending Push To Talk notifications
We’re sending PTT notifications from our server and are receiving HTTP 403 from APNs for certain phones with the reason field BadEnvironmentKeyInToken. I can’t find this reason documented in Apple’s public error list. I’d like to confirm what this error specifically means and how to resolve it. Any guidance or clarification would be greatly appreciated. Thank you. Here is the document I was referring to. https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html
2
2
420
3w
Push notifications on macOS "discarded due to expiry"
I'm having a reproducible problem receiving push notifications on macOS 26.2. The pattern is that the push is received and then discarded almost immediately (there is a 60s expiration date) when on battery power and then when I plug in pushes start working and even if I unplug again it works for hours until breaking again. These are alert notifications with priority 10. Other team members have had similar problems but less reliably broken and even get a "stored for device power considerations" message followed by discarded (see apns-unique-id c29250a3-abbf-008a-96f9-a5384e32d1df). An example from my machine with the apns-unique-id 6b2dfe3d-af99-182a-0e1e-6b811d3ec486 which fails immediately. iOS is working fine however so this seems to be confined to macOS only.
1
0
188
Jan ’26
SwiftUI: UNUserNotificationCenter delegate not called on cold start when opening notification
I'm sending local push notifications and want to show specific content based on the id of any notification the user opens. I'm able to do this with no issues when the app is already running in the background using the code below. final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate { let container = AppContainer() func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { let center = UNUserNotificationCenter.current() center.delegate = self return true } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void) { container.notifications.handleResponse(response) completionHandler() } } However, the delegate never fires if the app was terminated before the user taps the notification. I'm looking for a way to fix this without switching my app lifecycle to UIKit. This is a SwiftUI lifecycle app using UIApplicationDelegateAdaptor. @main struct MyApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate var body: some Scene { WindowGroup { ContentView() } } } I’m aware notification responses may be delivered via launchOptions on cold start, but I’m unsure how to bridge that cleanly into a SwiftUI lifecycle app without reverting to UIKit.
0
0
153
Jan ’26
Silent Notification Delivery Guarantee
We have been experimenting with silent notifications to update the content in our app and connected bluetooth peripheral at regular intervals. We are facing issues every once in a while with some users not receiving the notifications reliably even if the app is in the background and not killed. Is there a way we can ensure we reliably receive notifications every time without any issues? If there is no guaranteed delivery with silent notifications, then is there any other way that we can explore to achieve our use case?
1
0
107
Jan ’26
Notification Identifier not showing on my profile
Im creating a basic app, needs push notification capability. I have created two profiles (development & distribution), selected my app in Identifiers and checked the PN box to enable it (no need for broadcast). I add the profile to Xcode and it says "Provisioning profile "New VP App Jan 2026" doesn't include the Push Notifications capability." What am I missing?
1
0
101
Jan ’26