Notifications

RSS for tag

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

Notifications Documentation

Post

Replies

Boosts

Views

Activity

Notification Service Extension is initialized but never triggered
Hi all, I'm attempting to implement a notification service extension for my app, however I'm running into some troubles with triggering the extension. The service extension is successfully installed with the app, and is initialized when a notification is received (which ive confirmed by attaching a debugger to it), however the didReceive method is never called. In the debugger console, the following message is printed: Service extension base class recieved didReceiveNotificationRequest: . I can confirm that the all the payload requirements are met to trigger the extension, and I was able to create an extension that would trigger in a blank application (using the same payload). It's only this app that prints this message to the console, and does not trigger. The extension code is as follows (I've removed all of the intended functionality at this point to try and pinpoint the issue) class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override init() { self.contentHandler = nil self.bestAttemptContent = nil print("startup!") } func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) async { let logger = Logger(subsystem: "app.revolt.chat", category: "notificationservice") logger.info("Invoked notification extension") debugPrint(request) self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) guard let bestAttemptContent = bestAttemptContent else { print("content is null") return } bestAttemptContent.title = "beans" if request.content.categoryIdentifier != "ALERT_MESSAGE" { bestAttemptContent.subtitle = "not an alert message" contentHandler(bestAttemptContent) return } contentHandler(bestAttemptContent) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { contentHandler(bestAttemptContent) } } }
0
0
415
Jul ’24
iOS 18 beta 3 CarPlay issues
I’ve been using iOS beta 3 for a few days, and I’ve began to notice that I am not able to send messages through CarPlay. At first, I thought it was a bug with my phone, so I restarted it. Then, I removed my car from CarPlay and reconnected, then connected it to a family members car and still have the same issues. The issue being whenever I try to send a message using Siri, she replies with “There is not an app for that, download one when not in the car.” Or something along those lines. If anyone else is having the same issue, or knows a fix, please let me know.
23
12
6.6k
Jul ’24
Broadcast push being throttled with very little traffic
Hi, We've implemented the new Live Activity Broadcast push notifications (https://developer.apple.com/documentation/usernotifications/setting-up-broadcast-push-notifications) and are testing this out in sandbox/development. Looking at our logs I can see that we tried to send 54 broadcast notifications the last hour. 16 of these failed with "429 Too Many Requests". We probably have no devices registered on any of the channels at the moment. These are all channels from the "Development" environment. Any pointers to what could be wrong? Regards, -Tommy
4
0
374
Jul ’24
Local push for wake up an app
Hello, We a company that deals with alarm systems in hospitals and we would need to manage, for one of our apps, that the application, even if in the background, can be reactivated and brought to the foreground showing the type of alarm received. We learned of a Dutch company who, they say, thanks to a special agreement with Apple, managed to achieve this using Local Push. We have already done something similar with Android through Foreground services and we would like to do something similar for iOS too but at the moment we have not succeeded because it seems the OS of mobile devices does not allow it. Apart from the normal documentation on local push I can't find much other information about it. Is there anyone at apple who could help me? Thanks
1
0
411
Jul ’24
Set up-to-date badge count when using UNNotificationRequest with trigger
hi, I am trying to schedule a UNNotificationRequest at a certain date using UNCalendarNotificationTrigger, and I also want to update the badge count accordingly. However the badge property in UNNotificationContent can only be set when adding UNNotificationRequest, not when the trigger is fired or notification is actually delivered. How can I set up-to-date badge count if notification is scheduled in the future? For example, if I scheduled notification A to 3 hours later with badge count 1, and in between I got notification B, badge count should be 2 when A is delivered but it will be 1. I am aware of didPresent delegate which can be used when app is in foreground when notification is delivered, but is there any delegate that is called when UNNotificationRequest is delivered and app is backgrounded or we are using NSE? Thanks.
1
0
384
Jul ’24
Issue with Suppressing Push Notifications Using UNNotificationServiceExtension
Hello, I have developed an update for my app where I handle push notifications (from APNs or FCM) and manage different notification categories using checks, storing the values in UserDefaults. So far, everything works fine, and the logs correctly indicate the state of each category when a notification is received. The issue arises when handling notifications in three states: foreground, background, and terminated (killed). I am using UNNotificationServiceExtension and in the didReceive method, I check the state of the notification. Depending on whether the state is true or false, I want the notification to be shown or not to the user. However, despite my efforts, the alert/notification part of the payload always ends up being displayed. Additionally, I have disabled serviceExtensionTimeWillExpire as it was being triggered, but still, after a few seconds, the notification ends up appearing. I have configured everything correctly, including mutable content, notification handling, etc. How can I prevent these notifications from being shown to the user when needed? Thank you for your assistance!
2
0
299
Jul ’24
MDM ActivationLockRequest Error 405
按开发者文档进行请求,响应405 接口文档:https://developer.apple.com/documentation/devicemanagement/activation_lock_a_device 实际请求如下: curl --location --request POST 'https://mdmenrollment.apple.com/device/activationlock' --header 'X-ADM-Auth-Session: 1720513551341O1O293...' --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' --header 'Content-Type: application/json' --header 'Accept: /' --header 'Host: mdmenrollment.apple.com' --header 'Connection: keep-alive' --data-raw '{"device": "FNXQX..."}' 这个问题要怎么解决?
1
1
256
Jul ’24
App Store App Push Notification Delivery Issue
We are experiencing issues with Push Notification delivery for our Lulu Money application (com.lulu.luluone) using Apple ID 1163514668. Upon reviewing the Push Notifications console, we have found that out of the 7.294M Priority Notifications sent in the last 4 weeks, only 1.226M were delivered to the device. The majority of the undelivered notifications, totalling 5.479M, are categorized as "Stored - Device Offline." This issue is negatively impacting our customers, and we need assistance in resolving it to ensure smooth notification delivery.
2
0
378
Jul ’24
Multiple pending APNS notifications delivered at once when the app enters foreground
I am working on a VoIP based PTT app. Uses 'voip' apns notification type to get to know about new incoming PTT call.  When the app is in foreground, the app gets to know about incoming VoIP PTT call through incoming push notification. After receiving notification, the app receives audio from the server. This works properly, as expected. The app faces issues in receiving apns notifications only when the app is in background. Issue: My app is in background and iPhone locked, the server sends apns notification to the target iPhone about a new incoming VoIP call. Server received 200 success response code from APNS. But the app in background did not receive the notification. Second time, the server sends notification about second VoIP call. App did not receive notification. Third time, server sends notification about 3rd incoming call. This list goes on. Everytime server sends a notification to the target phone, success response is received from APNS. 
 Now, bring the app to foreground, the app receives all the pending notifications at once. This scenario happens only in a few phones. Those customers are missing PTT calls.
Can you please provide us suggestions to solve this issue ? My app uses unrestricted-voip entitlement
0
0
381
Jul ’24
How to archive an app with NotificationServiceExtension?
I was able to successfully archive my main app that has a NotificationServiceExtension. However, once I installed the app via Testflight, I was able to receive a notification, but the push notification modifications I did were not applied. When I just ran it via Xcode, the push notification modifications worked. Do I need to archive the NotificationServiceExtension instead of my main app?
1
0
373
Jul ’24
Does Remote Notification (content-available) not work in iOS's Not running and Suspended state??
Hello, I would like to implement the function of unsubscribe FCM topics that I was subscribing to when I received a specific push from the server. It was implemented through "willPresent" when the app was running, but I don't know how to do it when the app is not running. I activated the 'Background fetch' and 'Remote Notifications' options for now. const message = { notification: { title: 'FCM Topic UnSubscribe', body: 'TestTestTest', }, data: { payload: JSON.stringify(payloadJson) }, apns: { payload: { aps: { sound: 'default', 'mutable-content': 1, 'content-available': 1 } } }, topic: 'unsubscribe_topic', }; Test node code Payload contains the type of topic you want to unsubscribe from. And I added a function to receive push from didReceiveRemoteNotification and handle logic. But this doesn't work. Does Remote Notification (content-available) not work in iOS's Not running and Suspended state?? I'm also using the Notification Service Extension, is this related to it?
1
0
532
Jul ’24
VoIP push notifications may not be received
Users of my app have reported that they are sometimes unable to receive Voice-over-IP (VoIP) push notifications when using a SIM. (There is no problem when using WiFi) VoIP push notifications were not received during the following period. Could you confirm diagnostic logs and could you please tell me why my app can't receive VoIP push? [diagnostic logs] https://drive.google.com/drive/folders/1gSAbr1Fy1SrjlmRXuAzoXqiaxnNbFhj8?usp=sharing [Problem period] 2024/06/17 05:34:59 - 2024/06/17 09:04:42 Number of times that the push server pushed and it received a normal APNs response: 31 Number of times that iPhone received pushes: 0 2024/06/17 23:05:03 - 2024/06/18 09:02:16 Number of times that the push server pushed and it received a normal APNs response: 192 Number of times that iPhone received pushes: 0 2024/06/15 00:35:56 - 2024/06/15 09:55:57 Number of times that the push server pushed and it received a normal APNs response: 138 Number of times that iPhone received pushes: 0
11
0
803
Jul ’24
Managing notifications and extension expiring certificates
Hi everyoneI I’m maintining an app that uses the Notification Service Extension entitlement (which I have never used before). The app is not published on the App Store but is delivered OTA via a website. previous developer told me that to avoid certificate expiration issues, they started using the APNs Auth Key on the server in the past. However, I now have two certificates close to expiration on the developer profile page. Both certificates are of the type "Apple Push Services": The first one is named with my app's bundle ID (MyInstitution.AppName). The second is named after the Notification Service Extension entitlement (MyInstitution.AppName.NotificationServiceExtension). In the Key section on the developer profile page, under Certificates, Identifiers & Profiles -> Keys section, there is a key named "MyInstitution NSE." My questions are: What should I do with the expiring certificates now that the app is using the APNs Auth Key? Is the Notification Service Extension entitlement working separately from the APNs Auth Key? In the end, does something really need to be renewed? What needs to be renewed, and how? When should I perform this operation if needed? Do I need to create a new .ipa file and distribute it? I have added some screenshots to be clearer (names hidden for privacy concerns):
3
0
580
Jul ’24
Push notifications are not displaying when app is in foreground
I have some C++ code to embed in my Application and hence enabling the setting C++ and Objective C ++ compatibility settings to C++/objective-C++ under build settings of my project .Once I enable it I am not receiving any push notification display when I'm in foreground even though I have the required willPresent function handler in app delegate. Also observed that the code is going into didReceiveRemoteNotification function handler. But once I disable the setting or change the setting to c/objective-c,then the flow is working fine and I'm getting the push notification on foreground. Request you to please help me here
1
0
293
Jul ’24
Seeking guidance on intercepting system-wide notifications in macOS app
I'm developing a macOS application called Blurt, which aims to provide enhanced notification management in MacOS. The core functionality I'm trying to implement is the ability to intercept and display notifications from various applications in a custom interface. Current implementation: Using AppDelegate to handle application lifecycle Implemented UNUserNotificationCenterDelegate for handling notifications Created a custom NotificationService extension Challenges: Unable to intercept notifications from other applications System notifications are not being captured by our app What I've tried: Using DistributedNotificationCenter to observe system-wide notifications Implementing a Notification Service Extension Exploring NSWorkspace notifications Current roadblocks: Apple's sandboxing and security model seems to prevent direct access to other apps' notifications Unable to find a sanctioned API for system-wide notification interception Questions: Is there a recommended approach to creating a centralized notification management system within Apple's guidelines? Are there any specific system notifications or events we can legally subscribe to that might help achieve similar functionality? How do other notification management apps (if any exist) handle this limitation? Are there any upcoming APIs or features in macOS that might address this use case? I'm open to alternative approaches or pivoting the app's functionality if necessary. Any insights, suggestions, or resources would be greatly appreciated. Thank you in advance for your help!
1
0
761
Jun ’24
Push notification no longer receiving on iPhone after upgrade sonoma MacOS for development
We are using sonoma OS for generating device token for iPhone real devices, we are using certificate authentication mechanism for APNs cloud server to send the push notification to the actual device. Actual mobile device not receiving push messages, i am using my own client to send request APNs cloud. some how my actual device is not receiving push messages
1
0
280
Jun ’24
iOS Push to Talk Framework Not Working in Archive Build (Flutter)
I have developed an app using Flutter that utilizes the Push to Talk framework on iOS. The Push to Talk feature works perfectly in debug mode, but after archiving the build and installing it on an iOS 17 device, the Push to Talk functionality stops working. Here are the steps I have already taken: Enabled background modes. Enabled Push to Talk capabilities. Despite these settings, the issue persists in the archive build. Has anyone else encountered this issue? What additional steps or configurations are required to get Push to Talk working in the archive build on iOS 17? Any help or guidance would be greatly appreciated. Thank you!
1
0
533
Jun ’24