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

didReceive isn't called in CarPlay scene
I have set up an iOS application with CarPlay scene using carplay-driving-tasks entitlement. And as per latest policy changes I'm able to get push notifications in the CarPlay screen. But unlike from phone scene, when I tap on a notification from CarPlay I don't get a trigger on didReceive method to intercept the payload of the notification that user tapped on. Is there any other ways or configuration needed to get this working? I just need to get the payload and present an Alert template within the CarPlay when user taps on a CarPlay notification and the app opens.
0
0
22
2w
Notification Service Extension and the main thread
Question, if I am writing async code in the notification service extension, I understand it terminates after 30 seconds. If I want to wait until these async methods finish before calling the content handler, I believe an option I have is to use dispatch groups. However I am open to other solutions if there are better options. My question is, if I use dispatch groups, is there any issue in using the main queue here? Or does the main thread not make sense to use in the context of the NSE? dispatch_group_notify(group, dispatch_get_main_queue(), ^{ if (self.contentHandler) { self.contentHandler(self.bestAttemptContent); } }); Or is it recommended to instead use a different queue in the NSE? dispatch_queue_t nseQueue = dispatch_queue_create("com.blah.blah.nse.queue", DISPATCH_QUEUE_SERIAL); dispatch_group_notify(group, dispatch_get_global_queue(QOS_CLASS_(SOMETHING), 0), ^{ ... }); OR am I over thinking this? :) Thanks ahead of time, relatively new to iOS so just looking to learn/understand better.
3
1
206
3w
How to correctly convert the bytes type devicetoken obtained from the MDM description file to the 16-bit hexadecimal data required by APNS?
I have converted a large part of the data, but only 5% of the data was successfully converted. The failed devicetoken shows "bad devicetoken" when accessing APNS. Here are examples of failed conversions devicetoken. Is there any official documentation for this part? DeviceToken Orgin \xc2\xa1\xcb\x9cr\xc3\x81\xe2\x80\x9e\x01b\xc3\xbce1pf\t\xc2\xa7\xc3\x82v}\xc3\xa1\xc3\x9a:?\r\n\xc3\xa5\xc6\x92\xc3\xb7y\xc3\x9e\xe2\x80\x9c\xc3\x89r
0
0
41
3w
Can I enable push notifications in an iOS app built from a web app URL using PWA Builder?
Hi all, I have a React web app that we use as a Progressive Web App (PWA). We currently: Use PWA Builder to package it for Android and iOS Host the app on a secure HTTPS URL Use Firebase Cloud Messaging (FCM) for push notifications (working on Android) However, on iOS, we are unable to get push notifications to work. I understand that PWAs on iOS have limited push support (Safari only, and not through WebView). So I explored using Capacitor, but: Capacitor can load a server.url pointing to our hosted app (great for reuse), but push notifications don’t work If we build the web app locally (npm run build) and embed it in the native iOS shell via Capacitor, push works We would prefer not to fully merge our authentication and main app UIs if avoidable Questions: Is there any approved way to enable push notifications in an iOS .ipa built from a hosted web app (URL) using PWA Builder? If not, is embedding the web assets locally the only Apple-approved way to get push support? Are there any best practices or native plugin recommendations (e.g., APNs or FCM) for handling push notifications in iOS app? Thanks in advance for any guidance. 🙏 Let me know if more technical details would help.
1
0
43
3w
No notification sound when CarPlay is connected
We're building a taxi driver app. Our goal is simple: Play a notification sound when a new ride request arrives — even if the iPhone is connected to CarPlay. We use Firebase push with "sound": "default" and "interruption-level": "time-sensitive". The app requests .carPlay and uses a category with .allowInCarPlay. Everything works when CarPlay is disconnected — we get sound and banner. But when connected to CarPlay: the push is delivered silently, no sound is played (even on the phone), Siri Announce is enabled, but nothing is spoken. Questions: Is notification sound blocked when CarPlay is active, unless the app has CarPlay entitlement? Is Siri Announce the only way to notify the driver audibly in this case? Would getting a CarPlay entitlement (e.g. CarPlay.communication) fix this without building a full CarPlay UI? Thanks — all we need is a reliable sound alert when a new ride comes in.
2
0
39
3w
Smart Adaptive Volume & Brightness - Say Goodbye to Noise & Visual Pollution!
Hello everyone in the iOS Devolution community! I'd like to share a suggestion that I believe would bring an unprecedented level of intelligence and comfort to the daily iPhone experience: Smart Adaptive Volume & Brightness. The Problem We Aim to Solve How many times has your iPhone rung too loudly in a quiet environment, embarrassing you in a meeting or waking someone up? Or, the opposite, you missed an important call on a busy street because the volume was too low? And what about screen brightness? It's a constant adjustment: too bright in the dark, hard to see in the sun. Currently, we have to manually adjust volume and brightness, or rely on Auto-Brightness (which only works for the screen) and Focus modes, which can be a bit "all or nothing." This leads to interruptions, frustration, and that feeling that your phone isn't really adapting to you. The Solution: Smart Adaptive Volume & Brightness My proposal is for iOS to use the iPhone's own sensors to dynamically adapt notification and ringtone volume, and screen brightness, to the environment we're in. How it would work in practice: Environmental Scan Before Ringing/Displaying: When a notification (call, message, app alert) is about to be delivered, and even before it makes a sound, the iPhone would briefly activate its sensors. The microphone would read the ambient noise level (in decibels), but without recording audio or analyzing any content. Just the "noise" of the surroundings. The ambient light sensor would assess the light intensity around the device. Intelligent and Coordinated Adjustment: Based on these combined readings of noise and brightness, iOS would make the adjustments: In noisy and bright environments (e.g., on the street during the day): The ringtone volume would be automatically increased to ensure you hear it, and the screen brightness would also be raised to facilitate viewing in strong light. In quiet and dark environments (e.g., cinema, bedroom at night): The volume would be discreetly reduced to avoid disturbances, and the screen brightness would be dimmed for your visual comfort and to avoid bothering others. Adjustments would be gradual, adapting to any type of environment (office, cafe, etc.). User Control: Of course, we'd have the option to enable or disable "Smart Adaptive Volume & Brightness" in the settings. We could also define minimum and maximum limits for these automatic adjustments, ensuring the iPhone adapts to our personal comfort levels. This feature would complement existing Focus modes, operating within the permissions of any active Focus. The Benefits for the User Goodbye to Inconvenient Interruptions: No more startling loud rings in quiet places. Never Miss a Call Again: In noisy environments, your iPhone will adapt to be heard. Constant Visual Comfort: The screen will always be at the ideal brightness, without blinding you in the dark or disappearing in the sun. Smoother Experience: Fewer manual adjustments, more time to focus on what matters. Guaranteed Privacy: The use of microphones and sensors would be strictly for environmental measurement, without recording or analyzing personal data. I believe this feature would bring a new level of intelligence and usability to iOS, making the iPhone even more intuitive and adapted to our daily lives. What do you all think of this idea?
1
0
28
Jun ’25
CarPlay: no banner or sound for APNs while connected, works on phone (iOS 18.0, UNNotificationCategoryOptions.allowInCarPlay)
Hi everyone! I’m integrating push notifications for a taxi-driver app and ran into a blocking CarPlay issue. When the iPhone is connected to CarPlay (wired or wireless), the push arrives on the phone without any sound and nothing is shown or announced on the CarPlay screen. If I unplug CarPlay, the same push plays the default sound and shows a normal banner on the lock screen, so the payload itself looks valid. Environment iPhone 13 Pro, iOS 18.0 CarPlay head-unit: Xcode 16.2 CarPlay Simulator App built with Flutter 3.22 + firebase_messaging: ^15.2.5 Deployment target: iOS 14.0 Xcode capabilities enabled: Push Notifications, Time-Sensitive Notifications App settings on the device: Allow Notifications -› Sounds ON, Show in CarPlay ON Siri › Announce Notifications › CarPlay: master toggle ON + my app added to the allowed list Driving Focus = Off (same result if it’s On) Native setup in AppDelegate.swift UNUserNotificationCenter.current().requestAuthorization( options: [.alert, .sound, .badge, .carPlay] ) { _,_ in } let carPlayCategory = UNNotificationCategory( identifier: "CARPLAY_ORDER", actions: [], intentIdentifiers: [], options: [.allowInCarPlay] ) UNUserNotificationCenter.current().setNotificationCategories([carPlayCategory]) UNUserNotificationCenter.current().delegate = self application.registerForRemoteNotifications() APNs payload that I send via FCM { "aps": { "alert": { "title": "New test order", "body": "Location info test" }, "sound": "default", "category": "CARPLAY_ORDER", "interruption-level": "time-sensitive", "relevance-score": 1 } } What could be the problem? Please help me solve the error
2
0
67
Jun ’25
api.push.apple.com always return 400 bad devicetoken
everytime i get my devicetoken from mdm certification,send to apns (api.push.apple.com 443),always return 400,please help me confirm if the devicetoken is expired or somethine wrong else here is the request and response device_token:79c3aec2b2c2b672c3b756c3910977c3a936c3aae280985ac380e280a6091cc2bfc3a132192b14c392c2be7a2ee280a229c3aa push_magic:AAFDAB81-0E63-4B72-A60A-1F8085325870 status_code: 400 headers: {'apns-id': '14BDD477-7D76-A2FB-582C-140BBD95A420'} resp: {'reason': 'BadDeviceToken'}
1
0
44
Jun ’25
Screens added / removed continually when display turned off
I have a function in my app to detect if screens are added or removed, watching for notifications from NSApplication.didChangeScreenParametersNotification. I am seeing some strange behavior when the screen attached to a Mac mini is turned off, macOS will spit out hundreds of the didChangeScreenParametersNotification, all relating to a 'ghost' screen being added and then subsequently replaced with the original screen a second later. This cycle will go on for hours until the screen is turned back on again. I can confirm this also happens with the CoreGraphics equivalent, with flags .added and .removed being the only changes. I would imagine this creates immense churn for all apps watching for screen changes. I've tried debouncing the notifications but even with a delay of 10 seconds this is still being called hundreds of times while the computer is idle and the screen is off. One constant I can see is that the CGDisplayUnitNumber() for the 'ghost' display is always 0, while the logical unit number for the real screen is '1'. Is it safe to ignore screens with 0? I'm trying to find a reliable way to prevent heavy processing for 'false' screens. I'm afraid because this ghost screen has parameters so different to the actual screen, it's otherwise not possible to ignore it as it looks like a new screen. See example below: // Observe notification NotificationCenter.default.addObserver(self, selector: #selector(displaysDidChange), name: NSApplication.didChangeScreenParametersNotification, object: nil) // Function to update screens called from displaysDidChange func updateScreens() { let screens = NSScreen.screens for screen in screens { guard let screenDisplayID = screen.displayID() else { NSLog("Screen does not have a display ID: \(screen.localizedName)") continue } let screenIdentifier = "v\(CGDisplayVendorNumber(screenDisplayID)), m\(CGDisplayModelNumber(screenDisplayID)), sn\(CGDisplaySerialNumber(screenDisplayID)), u\(CGDisplayUnitNumber(screenDisplayID)), sz\(CGDisplayScreenSize(screenDisplayID))" } // -- Logic to determine if screen is new or already exists for window management -- NSLog("Found new screen display ID \(screenDisplayID) (\(screenIdentifier)): \(screen.localizedName)") } And the logging I'll get: Found new screen display ID 2 (v16652, m1219, sn16843009, u1, sz(1434.3529196346508, 806.823517294491)): Philips FTV Found new screen display ID 10586 (v1970170734, m1986622068, sn0, u0, sz(677.3333231608074, 380.9999942779541)):
7
0
62
Jun ’25
NSUserNotificationsUsageDescription only works for certain locales
I'm trying to provide custom localized descriptions for the iOS notification permission popup in my app, which supports multiple locales. To achieve this, I'm using InfoPlist.strings files per locale with the following keys: NSUserNotificationsUsageDescription NSUserTrackingUsageDescription The issue I'm facing is that NSUserTrackingUsageDescription is working correctly across all tested locales, but NSUserNotificationsUsageDescription only works for some locales. Locales tested: Working: ja, tr, fr-CA Not working: fr-BE, nl-BE In each case, the correct localized NSUserTrackingUsageDescription appears, but the NSUserNotificationsUsageDescription falls back to the default or does not appear as expected in fr-BE and nl-BE. I'm using Xcode 16 and testing on both iOS 18 simulator and physical devices, and the issue is consistent across both. Any insights on whether this is a known issue in iOS or if there are additional steps needed for NSUserNotificationsUsageDescription to localize properly would be greatly appreciated.
1
0
101
Jun ’25
Persistent iOS Signing & UIBackgroundModes Entitlement Issue
Problem Statement We are experiencing a critical and persistent issue preventing the successful signing and building of our iOS application. The core problem is that provisioning profiles, whether automatically generated by Xcode or manually created in the Apple Developer Portal, consistently fail to include the UIBackgroundModes entitlement, leading to a build failure. Specific Question Why are provisioning profiles generated via the Apple Developer Portal and/or Xcode's automatic signing process consistently omitting the UIBackgroundModes entitlement for our App ID, even when this capability is explicitly configured in Xcode? We seek guidance or backend intervention to ensure our provisioning profiles include the necessary entitlement. Expected Outcome We expect to be able to successfully build and sign our iOS application, with provisioning profiles that correctly include the UIBackgroundModes entitlement, allowing for proper implementation of remote notifications. Observed Symptoms Primary Build Error: Consistent build failure with the exact error message: "Automatic signing failed: Provisioning profile 'iOS Team Provisioning Profile: com.scott.ultimatefix' doesn't include the UIBackgroundModes entitlement." Missing Entitlement in Profile (Confirmed by Inspection): Direct inspection of downloaded .mobileprovision files (including those manually generated in the Developer Portal for com.scott.ultimatefix) consistently shows the absence of the UIBackgroundModes entry within the section of the Entitlements dictionary. The aps-environment key for Push Notifications is present, indicating Push Notifications are enabled, but Background Modes are not. Certificates Correctly Recognized in Xcode: Our "Apple Development: Stephen Criscell Scott" and "Apple Distribution: Stephen Criscell Scott" certificates are correctly displayed and recognized in both Keychain Access and Xcode's Preferences > Accounts > Manage Certificates window (without "Not in Keychain" status). Furthermore, the Signing & Capabilities tab for the target in Xcode now correctly shows Signing Certificate: Apple Development: Stephen Criscell Scott. Persistent Issue Across Resets: The problem persists despite extensive local cache invalidation, Xcode reinstallation, and even testing in a fresh macOS user account (which confirmed the issue was not user-specific).
1
0
92
Jun ’25
Provisioning Profile Missing com.apple.developer.push-notifications Entitlement Despite Correct Setup
Hi all, I’m running into an issue with provisioning profiles not including the com.apple.developer.push-notifications entitlement — even though everything seems to be configured correctly. Here's what I’ve done: Checked the App ID has Push Notifications enabled. I’ve clicked “Configure” and created a Production APNs certificate under the App ID. I’ve regenerated the provisioning profiles (Ad Hoc and App Store). I can see within the profiles within App Store Connect that the push notifications capability is listed I’ve downloaded and decoded the profiles using: security cms -D -i profile.mobileprovision > decoded.plist But com.apple.developer.push-notifications is still missing under the <key>Entitlements</key> block. This is causing issues because: When I submit the build to eas I receive this error from XCode: - Provisioning profile "*** Adhoc" doesn't include the com.apple.developer.push-notifications entitlement. Profile qualification is using entitlement definitions that may be out of date. Connect to network to update. (in target '***' from project '***') Refer to "Xcode Logs" below for additional, more detailed logs. To isolate the issue further I: Created a completely new App ID, enabling Push Notifications from the start. Created new APNs certificate. Generated new provisioning profiles with a valid distribution certificate. Still no push entitlement embedded in the profile. Question: Has anyone else encountered this issue where Push Notifications are enabled and configured, but the entitlement still fails to embed in the profile? Thanks in advance.
1
1
78
Jun ’25
Local-only iOS 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!
2
0
62
Jun ’25
Getting null data from App Store Server Notification
Hello Apple Support Team, We are using auto-renew plans in our app We have set the webhook URL in our App Store Connect account to get the Store server notification to get the auto renew data for an user The issue is when a user purchases any auto-renew plan at the auto-renew time, we are getting null data from the Apple side. We have printed the log's data to check what data are coming from the Apple webhook. we have attached our logs data please check it and let me know what can we do to resolve this
1
0
63
Jun ’25
Regarding the change of device tokens after an iOS update
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.
2
0
85
Jun ’25
How to connect to Apple’s legacy server-to-server subscription endpoints (StoreKit v1) to receive real-time notifications
Our mobile app uses a specific platform for subscription management. At this time,, it's integration with Apple notifications is built around the Server-to-Server Notifications v1 and the traditional verifyReceipt endpoint. At this time, it does not support Server-to-Server Notifications v2, nor has any published documentation or resources on a custom integration path using v2. Our app is built using Flutter and we handle purchases with the in_app_purchase plugin. However, due to the limitation on the system for subscription side, we need to connect to Apple’s legacy server-to-server subscription endpoints (StoreKit v1) to receive real-time notifications and validate receipts. Could you please provide information how to do it?
0
11
133
May ’25