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

User Notifications Delayed on Watch
Hi, when sending notifications either via APNS remotely or locally on watchOS, they are delivered with a small but significant delay of ~12 to 20s. That doesn't sound like much, but when e.g. the notification is read on AirPods by Siri via the iOS companion app on the phone it's quite annoying having to wait for the long-look notification UI to appear on the watch to e.g. send a quick reaction. Interesting: If the watch is not connected to the phone, notifications are delivered as quick as on the iPhone (<1s delay). That makes me think that this behavior must be related to the notification forwarding feature as described here https://developer.apple.com/documentation/watchos-apps/enabling-and-receiving-notifications . For a "Dependent watchOS app with an iOS app" it is stated that "You can either send the notification just to iPhone, or send it to both devices. In either case, the system ensures that the user only receives one notification at the best destination." So the watch must somehow coordinate with the iPhone to not show a notification if the "same" (same APNS collapse id?) notification is delivered to the phone as well (?). Is there a way to disable this behavior? Thanks! Quirin
2
0
867
Sep ’23
Push token change on app upgrade
Our app has some Crashlytics & Localytics reporting to collect metrics for diagnostic and info gathering. One thing I'm noticing recently is that if a user has version m of the app installed and updates to version m+1, then for some users, the app has detected and reported that the push token obtained with version m+1 is different from that of version m (for the same handset). That's fine - if the app has detected the change to the token it can send the new one to the server so the server can update. But my question is - if the user didn't explicitly launch the app and thus present the app with the chance to send the new token to the server, then what will happen to the pushes sent by the server using the old token? Presumably they won't get delivered if the token has changed, but if the user has no need to launch the app then they're never going to receive any pushes from the server until they do launch the app. However there's not necessarily any reason why a user should repeatedly launch an app once it's been set up (depending upon what it does and how it delivers info to the user and how the user interacts with it, there's no reason why a user should have to launch the app after initial installation and launch). If so then this seems like a gap in the design of push notifications? If they can change on the same handset, or another scenario is the user backs up their device to iCloud and then restores to a different handset, then in that case the push tokens will have definitely changed, yet any apps using push don't get the chance to send the new token to the server until the user launches the app, meanwhile all pushes from the server will be dropped.
1
0
586
Sep ’23
How to integrate Live Activity into Objective C projects ?
I have a food delivery app similar to Uber Eat it was developed in Objective C now the requirement is to implement the Live activity for tracking the Active orders in live Activity. As i tried Live activity over the Swift it is working fine on all IOS Devices but when i implement that swift code into Objective C using all the standards by Bridging between Swift and Obj C copied the same code, There is no Error or Warning i am seeing in Live activity functionality in Objective C, but Live Activity UI can't seen on Lockscreen even i have checked in settings my app is showing that it supports Live Activity but no view. Can somebody help me out in that how to integrate live activity into Objective C project?
0
0
464
Sep ’23
Not receiving response from APN server while sending push notifications
Hi, I am currently using the token based protocol to send iOS push notifications to users via my application. However, there are several instances when I receive no response from the APN server and as a result the notification is not sent. For the configuration that I am relying on, I am still able to send notifications to other devices. Kindly provide assistance on how to resolve this.
1
0
320
Sep ’23
Cannot create signature for JWT for APNs
I am trying to generate the signature for a JWT using a .p8 private key from Apple for APNs in PHP. If I try to use the following command hash_hmac('sha256', $header . '.' . $payload, $key), when checking it in Apple's JSON Web Token Validator, I get that the signature is invalid. I have also tried converting the .p8 private key to a PEM file and importing it into the OpenSSL library, but I am still getting the error message openssl_sign(): Supplied key param cannot be coerced into a private key. But I generate the JWT using Apple's JSON Web Token Generator, everything goes well, even the request to APNs. Thank you in advance!
1
0
625
Sep ’23
getting TooManyProviderTokenUpdates error in production for applet wallet notifications
Hi All, Product information Our product create and update apple wallet passes per client. For example, client A will have a passtypeidentifier and devices which download the same will have its devicetoken[pushtoken] registered to our database. Same for other clients as well. We had been using legacy binary protocol-based approach till 2021, and we migrated http2 based APNS API implementation in the same year. But past few months, we are getting TooManyProviderTokenUpdates 429 in the production environment. No such error occurring in our lower environment with the same build. We use separate p8 cert,key and teamId per environment. *Implementation we have total of 5 clients, i.e: 5 pass type identifiers. In our current implementation , we create 5 connections per client. hence 5 oauth token[which refreshes only after 20 mins] are created. As we are sending push notifications to Apple wallet passes, we send apns-id as passtypeidentifier , no payload in the body and uses https://api.push.apple.com/3/devies/[pushtoken] endpoint for sending push notifications. So, each connection will have passtypeidentifier defined in the aps-id and device token sent in the URL. We initially suspected, multiple connection for a team identifier would be an issue. So, in our lower region[never reported this error], we tested a new build which implements 1 single connection for all the clients and one Oauth token is being used. In this approach , pass gets updated on the devices, but no notification banner displayed on the devices. So,we reverted to production build and sent notification to those same devices, we found passes updated and notification banner appeared. We are totally confused with the error message and behavior of APNS. Any suggestions or solution would be appreciated.
1
0
521
Sep ’23
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
839
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
216
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
561
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
576
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
612
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
302
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
435
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
692
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.1k
Oct ’23