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.

User Notifications Documentation

Posts under User Notifications tag

170 Posts
Sort by:
Post not yet marked as solved
3 Replies
2.7k Views
When creating a new Multiplatform project on Xcode 14 beta and adding a Notification Service Extension Target, compilation fails with: error build: Your target is built for macOS but contains embedded content built for the iOS platform (Notification.appex), which is not allowed. This really limits the usefulness of the new multiplatform single target, especially if we cannot incorporate basic extensions. Is there any way to use single target multiplatform and still have the freedom to add necessary extensions to the app?
Posted
by
Post not yet marked as solved
2 Replies
622 Views
Hello, I have been searching for documents related to Safari push notification configurations. I have found this one below, but it is archived and not sure whether it's still reliable. Up-to-date documents are mostly redirecting to upcoming Safari version (Safari 16 which will support push notifications in a different way). Was just wondering if there is an updated version for the document below, or if its still reliable as a guide for sending pushes to Safari versions below 16. https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1
Posted
by
Post not yet marked as solved
3 Replies
1.5k Views
I have an app with the "Driving Task" CarPlay entitlement. When I ask for permission for notifications in CarPlay (UNAuthorizationOptionCarPlay), and I check "carPlaySetting" in the UNNotificationSettings after granting permission, it get a value "UNNotificationSettingNotSupported" (the setting is not available to your app). Is this a bug? It feels like one. The app shows distances to some locations, and provides warnings to the user when approaching those locations. It is common for my users to use it at the same time they use a navigation app and switch between the two apps. But when they have the navigation app in foreground, they ask why my app is not showing notifications when giving an audio warning. The notifications are not even shown on the screen of the iPhone, the screen is turned off in iPhone 14 Pro when connecting to CarPlay, and the screen does not turn on when the app is in background in CarPlay and tries to show a notification.
Posted
by
Post not yet marked as solved
2 Replies
963 Views
Hi, We need to use silent notifications in our app, even when the user kills the app. We requested Apple to get a NSE Filtering Entitlement on December 02, 2022 with follow-up number: 814879299 But after nearly 2 months, we still haven't got a response. So we also sent a TSI (Technical Support Incident) on January 09, 2023 with follow-up number: 817249684. DTS (Developer Technical Support) said that we need to use this specific entitlement and he has no involvement in the entitlement request process. We need a quick response for the NSE Filtering Entitlement because our business depends on Apple's response. @Apple, is it possible to get an estimation date for the response? @iOS_developers, how long have you been waiting for that permission?
Posted
by
Post not yet marked as solved
8 Replies
3.1k Views
Dear fellow developers, I have an issue where my didReceiveRemoteNotification method in the AppDelegate is never called. Here's what I did: I am developing a SwiftUI application for iOS 15 and 16 and am currently running tests in an iPhone 14 Pro Simulator. My Xcode version is 14.2 and the simulator is running iOS 16.2. I am of course talking about the AppDelegate's application:didReceiveRemoteNotification:fetchCompletionHandler: method, not the deprecated one. I embedded the AppDelegate in the following way: @main struct MyApp: App {     @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } The integration of my AppDelegate does work in general, meaning the didFinishLaunchingWithOptions is called. I added the background modes capability to my app, including both "Remote notifications" and "Background processing". With this configuration, I would expect the AppDelegate's method to be called. I tried sending different push notifications with different payloads and headers while having the app both in the background and foreground but without success. Just to rule out mistakes on my side that are obvious to someone else, this is how I embedded the method into my AppDelegate: class AppDelegate: UIResponder, UIApplicationDelegate { ... func application( _ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { print("Method called!") completionHandler(.noData) } } And here are a few payloads and headers that I tested. I tried all of the following payloads with the following headers in any combination. apns-push-type=alert or apns-push-type=background apns-priority=5 or apns-priority=10 Example 1: Visible notification { "aps": { "alert": { "body": "Test" }, "badge": 1, "content-available": 1 }, "test": "data" } Example 2: Silent notification without badge update { "aps": { "content-available": 1 }, "test": "data" } Example 3: Silent notification with empty alert block and badge update, based on ideas from this thread { "aps": { "alert": {}, "badge": 0, "content-available": 1 }, "test": "data" } As I said, no matter whether my app is in the foreground or background, the method is never called. At the same time, the userNotificationCenter(_:willPresent:withCompletionHandler:) method of the UNUserNotificationCenterDelegate is called when the app is in the foreground. At this point, I am running out of ideas what I could possibly be doing wrong, so I hope someone else has an idea what else to try.
Posted
by
Post not yet marked as solved
9 Replies
5.6k Views
Hi, I am trying out push notification for IOS 16.4 beta Simulator using Xcode 14.3 beta (14E5197f). Inside my JS code I have the following: Notification.requestPermission((permission) => { console.log(permission); }).catch((error) => { deviceNotSupported(); }); } Unfortunately "permission" always returns "denied". Please kindly assist
Posted
by
Post not yet marked as solved
1 Replies
1.1k Views
Hi, I'm testing the new web push notification feature introduced in iOS 16.4. I'm testing it in a PWA that I developed. Apparently all is working well. I can register the subscription and receive notifications. The problem is that I only receive the first three notifications sent. After receiving them, I don't receive any more until I subscribe again. Is there any limitation of notifications sent per hour or day with the same subscription token? Should I renew the subscribtion token in background frequently or it's not recommended?
Posted
by
Post not yet marked as solved
2 Replies
726 Views
With PTT we now have the possibility to wake the application up using the new PTT push notification payload. What if the device doesn't have internet access? What if the application uses Local Push Connectivity (with a Network Extension) to provide an alternative communication channel (a socket implementation in the Network Extension) in case there is no internet connection? Is there a way for the Network Extension to post this new type of PTT push notification to wake the application up?
Post not yet marked as solved
2 Replies
693 Views
Hi, How can I send push notification for point update and promos to my loyalty wallet users. Currently I get push notification Id when user install loyalty wallet and I use it for sending wallet updates. But when I tried to use this push notification id for custom APN messages it doesn't appear anywhere. Thank you.
Posted
by
Post marked as solved
1 Replies
763 Views
Since iOS 16.4.1 (potentially also 16.4, the last known working version was 16.3.1) some of our apps are unable to add notifications to UNUserNotificationCenter using add(_:withCompletionHandler:) iff these notifications have an attachment. The internal testing flavour of the same app, exactly the same code just with a different app icon, continues to work without any issues. The error message we receive in the completionHandler of ‌add(_:withCompletionHandler:) is Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL}. StackOverflow didn't yield any useful results. Digging deeper we looked at the console output of one of our test devices and noticed that SpringBoard logs Cannot stage attachment. Must provide either a connection or proxy, and not both immediately before the error is returned in our app. Is this actually an issue outside of our app? Is there something we can do to resolve this issue? Log from an iPhone 14 using iOS 16.5 Developer Beta 2 after receiving a push notification in our application. error 14:14:13.211481+0200 SpringBoard XPC current connection is unexpectedly nil fault 14:14:13.211920+0200 SpringBoard Cannot stage attachment. Must provide either a connection or proxy, and not both. Attachment: 'file:///private/var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg' fault 14:14:13.211970+0200 SpringBoard Cannot stage attachment. Must provide either a connection or proxy, and not both. Attachment: 'file:///private/var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg' error 14:14:13.212024+0200 SpringBoard Attachment file is not related to bundle: fileURL=file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, bundleIdentifier=<private>, stagingError=(null) error 14:14:13.212076+0200 SpringBoard Attachment file is not related to bundle: fileURL=file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, bundleIdentifier=<private>, stagingError=(null) error 14:14:13.212131+0200 SpringBoard Unable to resolve URL: attachment=<UNNotificationAttachment: 0x281546980; identifier: Image, URL: file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x280647200; displayLocation: default; thumbnailGeneratorUserInfo: { }>>, error=Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL} error 14:14:13.212182+0200 SpringBoard Unable to resolve URL: attachment=<UNNotificationAttachment: 0x281546980; identifier: Image, URL: file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x280647200; displayLocation: default; thumbnailGeneratorUserInfo: { }>>, error=Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL} error 14:14:13.212234+0200 SpringBoard Unable to stage attachment: attachment=<UNNotificationAttachment: 0x281546980; identifier: Image, URL: file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x280647200; displayLocation: default; thumbnailGeneratorUserInfo: { }>>, error=Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL} error 14:14:13.212286+0200 SpringBoard Unable to stage attachment: attachment=<UNNotificationAttachment: 0x281546980; identifier: Image, URL: file:///var/mobile/Containers/Data/PluginKitPlugin/********-****-****-****-************/Library/Caches/Images/Image.jpg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x280647200; displayLocation: default; thumbnailGeneratorUserInfo: { }>>, error=Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL} error 14:14:13.212444+0200 SpringBoard Hit error staging attachment, will roll back: error=Error Domain=UNErrorDomain Code=100 "Invalid attachment file URL" UserInfo={NSLocalizedDescription=Invalid attachment file URL} default 14:14:13.212548+0200 SpringBoard [com.*ourAPP*] Notification serviced by the communication context service: 0. Has context: 0. Type: (null) Log from an iPhone 14 using iOS 16.5 Developer Beta 2 after receiving a push notification in our internal test application. error 14:24:13.307140+0200 SpringBoard File at '<private>' already exists in the repository default 14:24:13.307198+0200 SpringBoard Moved attachment file into repository: attachment=<UNNotificationAttachment: 0x28053b940; identifier: Image, URL: file:///var/mobile/Containers/Data/PluginKitPlugin/D12633C1-E060-4CCC-95FD-16C5AC9E3005/Library/Caches/Images/Image.jpg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x28105a220; displayLocation: default; thumbnailGeneratorUserInfo: { }>>, repositoryURL=file:///var/mobile/Library/UserNotifications/********-****-****-****-************/Attachments/Image.jpeg default 14:24:13.307667+0200 SpringBoard Successfully resolved request: resolvedRequest=<UNNotificationRequest: 0x281e05860; identifier: ******, content: <UNNotificationContent: 0x9be9db0a0; title: <redacted>, subtitle: (null), body: <redacted>, summaryArgument: , summaryArgumentCount: 0, categoryIdentifier: SINGLE, launchImageName: , threadIdentifier: ********, attachments: ( "<UNNotificationAttachment: 0x28053f480; identifier: Image, URL: file:///var/mobile/Library/UserNotifications/********-****-****-****-************/Attachments/Image.jpeg, type: public.jpeg, options: <UNNotificationAttachmentOptions: 0x28105a220; displayLocation: default; thumbnailGeneratorUserInfo: {\n}>>" ), badge: 3, sound: <UNNotificationSound: 0x283b4aca0>, realert: 0, interruptionLevel: 1, relevanceScore: 0.00, filterCriteria: (null), trigger: (null)>, resolutionSuccess=YES, continueOnFailure=NO default 14:24:13.307780+0200 SpringBoard [com.*ourApp*] Notification serviced by the communication context service: 0. Has context: 0. Type: UNNotificationContentTypeDefault default 14:24:13.307832+0200 SpringBoard Getting effectiveSectionInfo for section identifier: com.*ourApp* default 14:24:13.307883+0200 SpringBoard [com.*ourApp*] Getting effective section info default 14:24:13.308689+0200 SpringBoard [com.*ourApp*] Got effective section info [ hasResult: 1 ]
Posted
by ForumsContributor
Post not yet marked as solved
16 Replies
5.4k Views
Hello Everyone! After push notifications were enabled we got to work on this feature. for our PWA. The problem that we are having is that they work great for a little bit and then they suddenly stop working. We thought it was our problem but after doing some research I found that many other developers are having this same issue. Push notifications work perfectly on Android but don't reach ios users. Is anyone else having the same issue? Can something be done to fix this? Thanks!!
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Hi there, Our app is installed on tablets provided to customer workers for performing tasks. We're currently implementing Push Notifications using AWS SNS and FCM. The goal is to send data-only (silent) push notifications to trigger a function that creates a record in the app's local DB. This approach allows us to control how the message is displayed in the foreground and background using Notifee. While this works well on Android in all states (foreground, background, killed), we're facing an issue on iOS, specifically in the release build. The silent push notifications only reach devices when the app is in the foreground, not in the background or killed states. Normal push notifications work fine, but we require the ability to send silent notifications for better processing control. Upon researching, we discovered that Apple has strict guidelines for these notifications to prioritize user experience, battery usage, spam prevention, and privacy. However, in our case, the tablets are dedicated work devices with only our app installed. Given this context, is there a reliable solution to send silent push notifications to iOS devices with the app in the background or killed states?
Posted
by
Post not yet marked as solved
0 Replies
270 Views
Hello! I have a problem with push notifications, notifications work fine in TestFlight, but after publishing the application to the store, push notifications stop working, what could be the problem? Maybe I didn't set the push permission somewhere in the 'App Store Connect' settings..
Posted
by
Post not yet marked as solved
0 Replies
516 Views
I implement the local push notification iOS from this example : https://developer.apple.com/documentation/networkextension/local_push_connectivity/receiving_voice_and_text_communications_on_a_local_network Everything works fine NEAppPushProvider intercept the message sended by the SimplePushServer but i want to develop my own server to push local notification what is the payload i must call to send notification to the ios application ? Any help will be appreciated
Posted
by
Post not yet marked as solved
4 Replies
1.1k Views
Hi. I developed a PWA app with fcm because iOS supports push api from iOS 16.4ver My server push message to fcm with this format. As you can see, we use webpush.fcmOptions.link to open the url page when users touch notification. On web browser and android, this option works but ios pwa don't. iOS just opens the PWA but can't open the url specified in fcmOptions.link. Is there anyone who knows about this? Can I fix it?
Posted
by
Post not yet marked as solved
0 Replies
443 Views
lately, we found out that all notifications from the app I developed suddenly vanished for no reason when a new notification arrived. Mostly this case happened on iOS 16, and the notification has threadID by which we want to fulfill the notification grouping. When I continuously sent 4-5 notifications to my iPhone this case will happen. Problem screen recording did anyone encounter this situation? Why and how to fix it
Posted
by
Post not yet marked as solved
0 Replies
475 Views
I have more markets and for all markets i must have 2 extensions for rich push notif, notification service and notification content. Only works for first market when i setuped extensions, but for rest markets action in rich push notification wont expand…
Posted
by
Post not yet marked as solved
0 Replies
316 Views
I’m a long-time Apple ambassador and use Apple devices in my personal and business life. For 11 years I asked your engineers to fix the problem with push notifications in mail app. They partly did it (after email to Craig Federighi) - but when I’m offline for hour or more, I don’t receive them. At the same time if there’s a new mail which was sent less than hour during this period it will push more old notification. I’ve checked it in the following versions: iOS 16.5, 16.6 Beta 2, 17.0 Beta 1; iPadOS 16.5, 16.6 Beta 2, 17.0 Beta 1. Seems that the problem is close to being solved, but not for 100% yet. Who has the same issue?
Posted
by
Post not yet marked as solved
0 Replies
474 Views
We recently developed the provisional permission for our app, but we have noticed that is not working as expected in iOS 16 (We have tested only there). Currently we request the permissions like this: UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound, .provisional]) { [weak self] _, _ in // here we register for pushes in case authorizationStatus is provisional or authorised } What happens is we do get the 1st notification with the keep CTA - once tapped we see that there pops an action: "Deliver Immediately", but even though the user selects that, we still see under setting the pushes are marked as "Deliver Quietly". In addition to this the sound and bage still stay as toggled off - and the lock screen and banner as well stay off. Basically, nothing changes after the user selects "Deliver Immediately"
Posted
by