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

Multiple push notification service
my app using FCM and pushy to deliver notif at the same time, the situation that is happening now is that I am getting two similar notification banners. How do I delete/cancel one of the notification banners when one of them has appeared. How do I handle this on the frontend side? If it is not possible/not recommended, can you please provide documentation from Apple so that it is best to change it on the server side
2
0
878
Sep ’23
APNS TooManyProviderTokenUpdates error
We are building a service that would handle push notification through APNS token authentication implementation. It is a multi-tenant service. We are aware of the fact that sharing same connection would cause TooManyProviderTokenUpdates (429) error. Therefore, we limit each connection pool to one app only. And we are only refreshing the token every 60 minutes. However, we are still running into this error lately. We are running multiple copies of our application simultaneous balance the load. Each one generates a different token. Is this a problem? Is sharing provider tokens across workers the only way to avoid this? Please advice.
0
0
223
Sep ’23
Method didReceiveRemoteNotification not called after device reboot
I'm using FCM and differents version of iOS (the oldest is 15.2) on a SwiftUI app. I'm working with silent notifications and everything works well with notifications. I can manage notification behaviour in foreground, in background and when app is killed. If i launch an fcm like this "to": "/topics/all", "priority": "high", "content_available": true, "data": { "custom_id": 1 } didReceiveRemoteNotification is called and all works well. If i use notification attribute like this "to": "/topics/all", "priority": "high", "content_available": true, "notification": { "body": "Sample body", "title": "Sample title" } "data": { "custom_id": 1 } i see the clickable banner and didReceiveRemoteNotification is also called. I can unistall and reinstll the application, everything still to works. Problem comes when i reboot/restart the device. After reboot, didReceiveRemoteNotification seems not to be called. if i use "notification": { "body": "Sample body", "title": "Sample title" } i see the clickable banner but didReceiveRemoteNotification is not called even after banner click. After reboot, I tried to send fcm keeping close the app, opening for first time by icon and opening for first time by notification banner but nothing change. didReceiveRemoteNotification remains not called. The only way to see didReceiveRemoteNotification already called is unistall and reinstall application. Sometimes it's starts to work again after many hours. It's looks like a strage behaviour. I saw a lot of documentation and topics about similar problems and i tried a lot of things, but nothing seems to solve this problem.
2
0
576
Sep ’23
APN service private keys - dealing with the 2-key limit
In my organization we limit the ability for any production-use private credentials from being used in a developer environment. This creates a challenge with APNs keys due to their apparent intended use being a single key across all apps of the org, with the 2nd allowed key being only for the key rotation use case. One idea I have to satisfy all concerns is to take advantage of the two key limit in a slightly different way: Generate the maximum two keys, and use one for dev environments and one for prod environments (with the key being secured according to our policies so that developers never get to see it). If we need to revoke the prod key at any point, we revoke the dev key, regenerate it and make that one the new prod key. Likewise, once that key is deployed in prod, revoke the old prod key and make that the new dev key. Does this seem like a viable approach? Are there any better ways to achieve a fully isolated setup where the production APNs key doesn't appear on a developer environment?
1
0
605
Sep ’23
Reloading data and rescheduling local notifications, based on AppIntent interaction in iOS 17 Widgets and Live Activities
Hi everyone, I have two questions regarding some issues with the new iOS 17 interactive widgets and live activities. Question 1: How can I update other Widgets and/or Live Activities, based on an AppIntent interaction in either one? I have several widgets that is displaying the same information, but in different sizes (Small, Medium, Large and Lockscreen). Most of our users are using many of them together on their Lockscreen and Home Screen. When they are interacting with the AppIntent button in either the Widget og LiveActivity it does not update and vice-versa. Based on the documentation it's pretty clear that interacting with a Widget it will update the timeline for that specific widget after the .perform() in the AppIntent is returned. Unfortunately, I also need to update the LiveActivity and the other TimeLines for the rest of the widgets. I have tried to use the WidgetCenter.shared.reloadAllTimelines() but it seems like it does not update the LiveActivity or the LockScreen widgets correctly. Question 2: How can I update and reschedule the local notifications based on the interaction in the Widget and Live Activity? The app sends a local notification whenever an activity starts or stops (e.g like a pomodoro timer with intervals). Let's assume the user have setup a 30 minute activity in the app, but now decides to pause the activity from either the widget or live activity. I then want to remove the scheduled local notification that was supposed to be fired in 30 minutes. I haven't been able to read from the documentation if this is possible, but would like to know if there is any way this can be performed. Looking forward to hear if anyone have encountered the same challenges :)
1
0
631
Sep ’23
After updating to iOS 17, I receive multiple notifications multiple times on my iPhone
When sending notification messages, the Apns package is used to send them. I set only the title and body without any additional settings and sent a notification message, but an error occurred in some iPhone devices where multiple messages with the same content were received. Has anyone experienced something like this? How can this be confirmed and processed to resolve this? This situation occurred in iPhone 12, 12maxpro, 14, and 14pro.
1
2
1.6k
Sep ’23
APNS key for multiple Teams
Hello, I have a question about APNS key usage for different teams. Is Key ID created in https://developer.apple.com/account/resources/authkeys/list is scoped only for that particular Team? Or can I use this Key ID for all Teams in organization? Context: We have problem integrating APNs Auth keys (from different teams). Thank you for your answer
1
0
308
Sep ’23
Tracking pushTokenUpdates and activityStateUpdates when app isn't running
Hello team, I'm looking for advice, please, about how to track updates to Activity.pushTokenUpdates and Activity.activityStateUpdates if my app isn't running. These two async sequences work great when my app is running, but that information is just as important if, for some reason, my app isn't running. In the WWDC video Update Live Activities with push notifications, the presenter says: when the system requests a new push token for an existing activity, your app will be given foreground runtime to handle it accordingly I was hoping that my app to be launched in the background... but I don't see how that would work unless there's a new call via the AppDelegate. Follow-up question... is there any documentation for the scenarios when a push token might be replaced for a live activity? Thank-you! Matthew
0
0
451
Sep ’23
notification issue ios 17
Since my last update on my iPhone I am unable to hear any notification from applications like Nest or Google Home. I have several videocameras that I need notifications and alerts from and the sound that the phone produces is ridiculous for sure will not alert me in any way. Not even vibration is possible to set. This problem needs urgent intervention, I suppose there are millions of users risking burgleries or other problems until it is not fixed.
1
0
708
Oct ’23
Error when running Live Activities
Hi there, This is my first time posting here. I'm working on small projects on Swift and SwiftUI now and then. I'm currently trying to develop an application that gets some bus arrival data using API and displaying them with live activities. The thing is that I'm not quite sure how frequently updates work yet. Still trying to figure out if I can update the live activity everytime the data coming right from the API changes or use push notification updates each minute passing by, but that is another thread that I'm going to focus with more details. Everytime i'm trying to deploy my app on my iphone or a simulator this error keeps popping up and I can't figure out why. Any ideas? Let me know if you need any snippet of my code. SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.gregorikouk.MapKitTut.BusWidgetKit' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.gregorikouk.MapKitTut.BusWidgetKit' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0xb1281d830 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0xb1282dfe0 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.gregorikouk.MapKitTut.BusWidgetKit)}}, FBSOpenApplicationRequestID=0xe5da, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2023-10-02 21:06:04 +0000"; } -- System Information macOS Version 14.0 (Build 23A344) Xcode 15.0 (22265) (Build 15A240d) Timestamp: 2023-10-03T00:06:04+03:00
3
0
1.2k
Oct ’23
MDM push doesn't response without any error. How can we avoid it?
Our MDM customers often claim MDM push is not delivered to device and cannot manage devices via MDM. TokenUpdate is not notified from the device on our MDM checkin server. APNs server response is 200 OK (successful) with the device token. MDM push is actually not delivered on device. We are really struggling to handle the claim because it is probably caused by iOS behavior, and AppleCare OS support doesn't help investigation about the issue. How can we investigate the reason why the push is not delivered? How can we know the current token value of the managed device? Reinstalling the MDM configuration profile is a way to know current MDM push token (it triggers TokenUpdate checkin command) Any other way to trigger TokenUpdate request on the device side?
3
0
1.1k
Oct ’23
Empty Curl Response
I am trying to send a POST to apns to update a wallet ID card. I am getting "empty response" from the server and not sure why. Any help appreciated. I am not sure if the device ID or pushToken are expected in the POST URL, but I tried both. :) starting curl Trying 17.188.143.66:443... Connected to api.development.push.apple.com (17.188.143.66) port 443 (#0) ALPN, offering h2 ALPN, offering http/1.1 successfully set certificate verify locations: TLSv1.3 (OUT), TLS handshake, Client hello (1): TLSv1.3 (IN), TLS handshake, Server hello (2): TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): TLSv1.3 (IN), TLS handshake, Request CERT (13): TLSv1.3 (IN), TLS handshake, Certificate (11): TLSv1.3 (IN), TLS handshake, CERT verify (15): TLSv1.3 (IN), TLS handshake, Finished (20): TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): TLSv1.3 (OUT), TLS handshake, Certificate (11): TLSv1.3 (OUT), TLS handshake, CERT verify (15): TLSv1.3 (OUT), TLS handshake, Finished (20): SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 ALPN, server accepted to use h2 Server certificate: subject: CN=api.development.push.apple.com; O=Apple Inc.; ST=California; C=US start date: Dec 21 21:07:45 2022 GMT expire date: Jan 20 21:07:44 2024 GMT subjectAltName: host "api.development.push.apple.com" matched cert's "api.development.push.apple.com" issuer: CN=Apple Public Server RSA CA 12 - G1; O=Apple Inc.; ST=California; C=US SSL certificate verify ok. Using HTTP2, server supports multi-use Connection state changed (HTTP/2 confirmed) Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 Using Stream ID: 1 (easy handle 0x1f10c75e320) POST /3/device/<<device token>> HTTP/2 Host: api.development.push.apple.com user-agent: curl/7.73.0 accept: */* apns-topic: <<pass topic here>> content-length: 39 content-type: application/x-www-form-urlencoded We are completely uploaded and fine TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): old SSL session ID is stale, removing Connection state changed (MAX_CONCURRENT_STREAMS == 1000)! TLSv1.3 (IN), TLS alert, close notify (256): Empty reply from server Closing connection 0 TLSv1.3 (OUT), TLS alert, close notify (256): curl: (52) Empty reply from server ending curl
0
0
506
Oct ’23
How to download an MDM signing certificate and its trust certificates from the iOS provisioning portal
Hey, I am new to this forum and also new for apple developer. I have a company and need install MDM server for employee device management. I have already have a MDM server and now what I needed is to "Download an MDM signing certificate and its trust certificates from the iOS provisioning portal" from the doc https://developer.apple.com/documentation/devicemanagement/implementing_device_management/setting_up_push_notifications_for_your_mdm_customers I need help to tell me 1, How to Download an MDM signing certificate and its trust certificates 2, Where is the iOS provisioning portal 3, Is Apple developer account enough for this process
0
0
318
Oct ’23
CloudKit subscription only works when operation is performed in CloudKit Dashboard and not when done programmatically
I have set up a CKQuerySubscription in the default zone that sends a Push notification every time a record meeting the given criteria is deleted in a public CloudKit database. However, the notification is only sent when I delete the record via the CloudKit Dashboard and not when I delete a record programmatically. I have tried creating a record with User A on a device and then having that record deleted by User B on a different device but it doesn't result in User A getting notified. Additionally, the only case where the notification gets sent is on a device that is signed in with the iCloud account that I use for CloudKit Console. In other words, when I delete a record that was created by a user with a different iCloud account than the one I use for the CloudKit Console the notification does not get sent to that device - it's only successful on the device with the CloudKit Console iCloud account. What I expect to happen is the subscription to fire when the record in question is deleted regardless of how and by whom it is deleted. Is this possible? Any help would be appreciated.
1
1
519
Oct ’23
Triggering Push Notifications based on App Store Server Notifications
I am developing a mobile app that has a paid subscription. I am interested in triggering a push notification when users change their subscription status in the App Store - for example, if they were to turn off auto-renew on their subscription, that would trigger a push notification using APNS to offer a discount. How would I go about sending a notification to a specific user based on the Server Notification payload? It is unclear which, if any, of the response body payload can be used to identify the user. Furthermore, I need a way to associate this identification with a device token so I can send an APNS push notification to the user. I have had the notification toggle available on launch for a while. If I understand correctly, users toggling "Allow/Deny" for registerForRemoteNotifications() notifications only changes their local settings. My first instinct was to start storing user data when they consent or decline notifications on launch - I could store [some kind of user ID, notifications_allowed (bool), and the APNS device token]. That way, when receiving an App Store Server Notification, I can reference this table, then fetch their device token and send a push notification if they have agreed to notifications. However, this seems somewhat fallible because it doesn't track users who change their notification settings in their own setting later. To summarize, my questions are the following: How can I identify a user from an App Store Server Notification payload? How could I store an identifier along with the APNS device token when users consent or decline push notifications that can later be used to associate their device with an App Store Server Notification?
0
0
463
Oct ’23
Very occasionally a phone gets into a state where the OS cannot launch a notification service extension
This is about the 3rd time I've seen this now (in about 5 years of using notification service extension, however all the occurrences have been in the past couple of months so presumably its some recent instability). What happens is a push is sent to the handset and is meant to get intercepted by a notification extension, except that doesn't happen - not due to an error with the app - something internally has gone wrong with the OS. Once this starts the notification service extension can never receive pushes again until the phone is restarted after with the extension starts to receive the pushes again. I got log from the OS when it did this and found there was an RBSRequestErrorDomain Code=5 error [u A0F3A639-F287-4B0C-AADE-A6F547D91404:m (null)] [<private>(<private>)] Failed to start plugin; pkd returned an error: Error Domain=PlugInKit Code=4 "RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): **Error Domain=RBSRequestErrorDomain Code=5 "Launch failed**." UserInfo={NSLocalizedFailureReason=Launch failed., **NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111"** UserInfo={NSLocalizedDescription=**Launchd job spawn failed**}}}" UserInfo={NSLocalizedDescription=RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}} Can file a radar but just posting here first just in case anybody from Apple know what the OS error code and hence the reason. (longer console log available)
4
1
762
Oct ’23