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

Questions about ConsumptionRequest properties
Hello. platform: Please let me know which platform 'Non-Apple platform' is referring to. For example, Google or Amazon? And is it correct to mean the platform that consumed the products received due to in-app purchases? playTime: Does 'playTime' mean the time when the customer purchased the app and actually accessed the app? Or do you mean the time you accessed after the in-app purchase?
1
0
377
Jul ’24
Text-to-speech when you receive an important alert while the app is closed
If you are receiving a regular push notification and try to read the content of the push notification in AVSpeechSynthesizer, it will read the text when the app is in the foreground, but when the app is closed, stopped, or in the background, it will display “Unable to list audio folders” and the text cannot be read. I couldn't find anything in the documentation about whether this works for critical alerts, so if anyone knows, please let me know. This text has been translated with DeepL
1
0
207
Jul ’24
com.apple.developer.usernotifications.filtering
Nous souhaitons activer l'entitlement com.apple.developer.usernotifications.filtering pour notre extension MsgNotificationService. Pourriez-vous nous fournir des instructions supplémentaires ou activer cet entitlement pour notre App ID ? Si des informations supplémentaires sont nécessaires ou des étapes spécifiques doivent être suivies. actuellement cela n'a pas d'impact sur le build mais sur le product->archive. impossible upload le build Une idée, un conseil ? Merci,
2
0
317
Jul ’24
Are push to start APNs tokens the same across different live activity types?
The ActivityKit API requires developers to parameterize calls to pushToStartTokenUpdates by the live activity's attributes, e.g. for await data in Activity<AdventureAttributes>.pushToStartTokenUpdates { // Send token to server. } for await data in Activity<BoringAttributes>.pushToStartTokenUpdates { // Send token to server. } At runtime, I have noticed that the token is the same for the different live activity attribute types we support in our app. Can someone confirm if this behavior is consistent? If the pushToStartToken is the same across different live activity types, it can simplify our database design 🙏🏼.
2
0
480
Jul ’24
Custom Push Notification for Apple Wallet Pass not Showing up on iPhone
I've implemented pass generation successfully and it's updated through Apple's silent notification, which updates the passes to their latest versions. I want to send some marketing push notifications to the Apple Wallet App as shown in my post at stackoverflow. Here is the Silent notification implementation, which is working perfectly fine. const options: apn.ProviderOptions = { token: { key: fs.readFileSync("./certs/APNs_AuthKey_7YYF346FU5.p8"), keyId: "******", teamId: "******", }, pfx: fs.readFileSync("./certs/private_key.pem"), cert: fs.readFileSync("./certs/certificate.pem"), production: true, rejectUnauthorized: true, }; const apnProvider = new apn.Provider(options); async function sendSilentPushNotification( deviceTokens: string[], serialNumber: string ) { try { const notification = new apn.Notification(); notification.topic = "pass.com.digital.passmaker"; notification.payload = { aps: { "content-available": 1, }, serialNumber, }; notification.priority = 5; return await apnProvider.send(notification, deviceTokens); } catch (error) { logger.error("Apple Notification error: " + error); return error; } } Here is the marketing notification I am trying to send, it is working with success, but I don't see any notification on mobile phone. please help me to fix it. async function sendCustomPushNotification( deviceTokens: string[], serialNumber: string, title: string, body: string, category?: string, badge?: number ) { try { const notification = new apn.Notification(); notification.topic = "pass.com.digital.passmaker"; // Set the title and body of the notification notification.alert = { title: title, subtitle: "Pass Update", body: body, }; // Set the sound to play when the notification is received notification.sound = "default"; // Set the badge number on the app icon (optional) if (badge !== undefined) { notification.badge = badge; } notification.contentAvailable = true; notification.mutableContent = true; notification.aps.category = category; notification.aps.alert = { title: title, body: body, }; notification.aps.badge = badge; notification.aps["content-available"] = 1; notification.aps["launch-image"] = "https://banner2.cleanpng.com/20180423/gkw/.......jpg"; // You can still include the serialNumber in the custom payload notification.payload = { serialNumber: serialNumber, aps: { "content-available": 1, "mutable-content": 1, "interruption-level": "time-sensitive", }, }; // Set to high priority notification.priority = 10; return await apnProvider.send(notification, deviceTokens); } catch (error) { logger.error("Apple Notification error: " + error); return error; } } I literally receive a success response from api returning the device pushToken with no errors. However, no notification show on my iPhone
0
0
327
Jul ’24
Not receiving push sent when device was offline
Hi, we noticed some issues with our app when it comes to receiving pushs sent when a device was offline. We know that only one push is stored if multiple are received while the device was offline but we got reports of multiple users that aren't receiving any pushs that were sent while they were offline. Reinstalling the App didn't help. We ruled out the third-party providers we used as my first thought was that there was some issues with setting the expiry but it also happens if directly sent over APNs. With a development build and the sandbox APNs I had no issue receiving one push after getting back online. But after reinstalling the production app no push after being offline. Example sent with the Push Notifications Console but I also tested it with curl directly: curl -v \ --header "authorization: bearer ${AUTHENTICATION_TOKEN}" \ --header "apns-topic: de.alarm-it-factory.ACC-App-Xamarin" \ --header "apns-push-type: alert" \ --header "apns-priority: 10" \ --header "apns-expiration: 1721379960" \ --data '{"aps":{"alert":{"title":"Test","body":"Expiry Test 4"}}}' \ --http2 https://api.push.apple.com:443/3/device/46F201D299F2B900CF3BF3096341116B9D5A69D103F2C0ACF18634823F73AB79 Sent: 15. Juli 2024, 16:00:42,361 MESZ Received: not received Topic: de.alarm-it-factory.ACC-App-Xamarin BundleID: de.alarm-it-factory.ACC-App-Xamarin Token: 46F201D299F2B900CF3BF3096341116B9D5A69D103F2C0ACF18634823F73AB79 apns-id: ec14fba2-efa5-4ace-9e22-3e4e5a64d630 I sent test messages before and after acivating airplane mode to make sure I have the correct token.
1
0
316
Jul ’24
CommunicationNotifications error
I'm trying to use communication notifications but I am getting this error in my logs. I've already checked my entitlements and signing & capabilities. I have notifications, communication notifications, and siri enabled. [com.testapp] _UNNotificationContentType is 'UNNotificationContentTypeMessagingDirect' but messaging notifications are not allowed. Abandoning communication API features for all messaging notifications. Perhaps app isn't allowed to donate messaging intents or is missing the communication entitlement.
0
0
136
Jul ’24
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
416
Jul ’24
Notification filtering entitlement - no response from apple
For a few years now, I have submitted requests for com.apple.developer.usernotifications.filtering entitlement, but never got an approval/denial response from apple. even after contacting them via email, still didn't get a response about the request status. our app is an emergency alerts app, this entitlement is crucial for our app reliability. Last request i have sent has Case-ID: 7377207
1
0
448
Jun ’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
376
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
380
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
412
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
386
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 &amp; Profiles -&gt; 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
582
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
300
Jul ’24