User Notifications

RSS for tag

Push 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

137 Posts

Post

Replies

Boosts

Views

Activity

Unable to detect Network Extension configuration change while pushing MDM profile
My team is developing an enterprise VPN application that needs to respond to Mobile Device Management (MDM) profile installations and removals in real-time. Our app uses the NetworkExtension framework and needs to update the UI immediately when VPN configurations are added or removed via MDM. We are currently observing NEVPNConfigurationChangeNotification to detect VPN configuration changes: While NEVPNConfigurationChangeNotification fires reliably when users manually remove VPN profiles through Settings > General > VPN & Device Management, it appears to have inconsistent behavior when MDM profiles containing VPN configurations are installed programmatically via MDM systems. STEPS TO REPRODUCE From MDM Admin Console: Deploy a new VPN profile to the test device On Device: Wait for MDM profile installation (usually silent, no user interaction required) Check Device Settings: Go to Settings > General > VPN & Device Management to confirm profile is installed Return to App: Check if the UI shows the new VPN profile
1
0
17
21h
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
180
1d
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
49
1d
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
45
4d
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
78
2w
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
170
3w
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
135
3w
long wait time for usernotifications.filtering entitlement
Hi, happy new year, I'm a Product Manager for a communications app that's currently in testflight. We requested the com.apple.developer.usernotifications.filtering entitlement on December 3rd, and have yet to receive a response from Apple. I understand that the holiday break may have gotten in the way, however it feels like we were lost in the queue as it's been 6 weeks with no response. Our app owner has checked-in inside appstoreconnect but has not received anything back. Is this common? Is there any process for getting a status update? Are we doing something wrong? Without this entitlement we cannot make the device ring in the background. The app is a voice and video messaging platform.
1
2
273
4w
Delay in notifications iPhone 16 Pro iOS 18.3
Hi, I’m having issues with push notifications on my phone across multiple apps. When someone sends me a message, I only receive the notification 10 to 15 minutes later. For example, on WhatsApp, people say that my chat only shows one checkmark when they send me a message. I don’t know what else to do. I’ve already contacted Apple Support, visited an Apple-affiliated physical store, and followed all the recommended procedures. This is my first time using an iPhone—I bought it for professional use, but it’s practically useless if I don’t receive notifications instantly. They even told me that if I send it in for warranty service, there’s a 90% chance they won’t detect the issue, and the iPhone will come back with the same problem.
2
2
775
Jan ’26
Push notifications were not successfully delivered and have bad status
Hello everyone, I have been working on a macOS app that utilizes push notifications for the past year. Up until recently, everything was functioning correctly. However, now I'm experiencing issues where push notifications are either not being delivered at all or are experiencing significant delays, sometimes up to 10 minutes. Setting the priority header to 10 hasn't made any difference. I am currently using development push notifications, but the issue persists when switching to the production environment. I'm curious if anyone else has encountered similar problems. When checking the push console, it frequently reports that the device is offline, even though it's actually online ("discarded as device was offline"). Occasionally, notifications are delivered promptly, but this is becoming increasingly infrequent. This issue has been consistently reported by our testers, particularly after they updated to macOS Sonoma. Any insights or assistance you can provide would be greatly appreciated.
18
9
5.4k
Jan ’26
Push Notification Delivery Delays and Failures on iOS Devices
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?
2
1
305
Jan ’26
Push Notifications Error
Hi, I'm experiencing an issue with my app. I use Firebase as my server, and it is great. Still, there is one issue: when I send push notifications from my app to users, the users will get the notification if the app is open, but not when it is closed. I have tried many solutions to fix it, even asking AI, but the issue is still there. I would be happy to give you access to Firebase and the Xcode workspace, as I have no clue how to fix it.
1
0
92
Jan ’26
The push notification icon is still displaying the old version
Hello guys, We have updated our app icon, and it is correctly reflected in our app build and assets. However, the push notification icon is still displaying the old version for some users. ✅ We have verified that: All icon assets in Assets.xcassets match the new icon. The app icon has been updated in Info.plist. The app has been resubmitted and approved on the App Store. ❌ However, some users still see the old notification icon, even after reinstalling the app. Restarting the device does not always resolve the issue. Could you provide insights into how iOS caches notification icons and how we can force a refresh for all users?
5
9
2.5k
Jan ’26
Push Notification Icon Not Updated on Some Devices After App Icon Change
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.
2
1
330
Jan ’26
Does UNNotificationRequest have a 64-notification scheduling limit?
Hi, We have a simple calendar reminder app that uses UNNotificationRequest to schedule local notifications for user events. I’m wondering whether UNNotificationRequest has a system-imposed limit of 64 upcoming scheduled notifications, similar to the deprecated UILocalNotification. We’re asking because one of our users is not receiving recently scheduled reminders. Our current workflow is: We schedule notifications on app launch and when the app is about to quit. Before scheduling, we call removeAllPendingNotificationRequests(). We then fetch the 64 nearest upcoming events and schedule them using UNUserNotificationCenter.current().add(...). This approach works fine during our testing, but we’re unsure what might be causing the issue for some users. Any insights would be appreciated. Thanks!
1
0
259
Jan ’26
Notifications filtering request - do we need separate approvals for apps belonging in the same account?
I have two apps - say A and B in my AppStore account, deployed in the AppStore. App A has obtained the com.apple.developer.usernotifications.filtering entitlement and this is added to my AppStore account by Apple after approval. Note that this is added for the account, and not for the specific app. Now, my app B also wants this functionality. Followed all the steps as done for app A - adding the already approved entitlement to my app B's identifier, regenerating the profiles, adding the key in the entitlements file, calling the completion handler with empty content like - contentHandler(UNNotificationContent()) Still the notifications show, the filtering is not working. Do I have to request the entitlement for App B separately? Even if I do request again, I am not sure if there is going to be any difference in the steps already done. The difference can only be if Apple has a mapping with the app id internally in their system, for the filtering to work? If I have white-labelled versions of apps A or B, do I have to request again then? Or does Apple restrict only one app to have this entitlement from one AppStore account? Please guide on the next steps here.
2
0
904
Dec ’25