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

Can't register for remote notifications
I've got a code that was making a successful registration for remote messages a few weeks ago. Here's how it was looking like: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { registerForRemoteNotifications(application: application) return true } func registerForRemoteNotifications(application: UIApplication) { UNUserNotificationCenter.current().delegate = self let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] UNUserNotificationCenter.current().requestAuthorization( options: authOptions, completionHandler: { _, _ in } ) application.registerForRemoteNotifications() } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { print(deviceToken) } A few weeks ago the didRegisterForRemoteNotificationsWithDeviceToken method was calling after registration, but now neither didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotification methods are called. Why could this happen?
0
0
392
Dec ’23
APNS returns 200 - Device did not receive Live Activities update
Hello! Currently we are reviewing an issue whereby our users were obtaining Live Activities update, but somehow at the end, there were Live Activity updates that were not properly received by the device. For example: 20 Live Activity updates sent to device, 17 were properly received, however the last 3 were not properly received (as can be seen by the UI of it not updating). So far we have looked into a few root causes highlighted on the forums and on stackoverflow: Timestamp of APNS (every one of the APNS has a different timestamp) 200 is seen from the APNS side, which is why we were confused by the push notification did not arrive on the device side Looking into our logs, its unfortunately not covered enough to tell us when this had been received Some questions here: Is there a way we could log every Live Activity / Push Notification received from APNS? (for all scenario, app on lock screen, app in background) Anyway to track a push notification's lifecycle? I know the Push Notification Console tool is useful for debug usage, but we wanted to see if there's something similar for production usage as well.
0
0
596
Dec ’23
iOS 17 Live activity animations
I've been trying to implement an animation for my live activity. The animation is just rotating an image back and forth a bit and offsetting it up and down a bit. It'll give an airplane icon a subtle effect of "flying". Similar to the waveform animation in Apple Music, ie it's there for a it of visual flair. The documentation here states that withAnimation is ignored so I'm not entirely sure how these "constantly animating" effects are achieved. It seems like animations can only occur as transitions between states but it seems like overkill for my use-case of just wanting to animate a tiny bit of UI. Any advice would be greatly appreciated
0
0
638
Dec ’23
Solving 0xbaadca11 crashes in few failure cases
The crash 0xbaadca11 seems to happen with PushKit and CallKit usage. I/we understand that as and when we receive voip push message from PushKit, we have to report the call to CallKit. However in some situations and data from payload (Like call with UUID already exists / payload decryption fails) where we are not supposed to report the call to user. The app gets crashed and further get blacklisted to get calls. Is there any way for developers to directly and silently report call failure to PushKit / CallKit.
1
0
468
Dec ’23
Registering for remote notifications not working on physical device
Hi there, There might be something obvious I'm overlooking, but I can't for the life of me figure it out. Any help or guidance would be much appreciated! I've enabled push notifications for one of my app identifiers (developer portal and provisioning profile appear to be correct, as does the entitlements file). On a simulator, when I call registerForRemoteNotifications(), I immediately get a callback from didRegisterForRemoteNotificationsWithDeviceToken. However, when I run my app on any of my physical devices, this method is never called. Nor is didFailToRegisterForRemoteNotificationsWithError. If I manually remove the aps-environment key and deploy to my device, then didFailToRegisterForRemoteNotificationsWithError is invoked with an expected error message. Any idea what I may have done wrong here? I'm using Xcode 15.0.1 and have tried an iPhone 12 (iOS 15.5) and iPhone 13 Pro Max (iOS 16.7.2). My development environment requires a VPN, but I've tried disabling the VPN in case that was an issue. I've also tried restarting the devices and toggling Wi-Fi, airplane mode, etc. My app does integrate with Firebase (not FCM though), but I added the FirebaseAppDelegateProxyEnabled NO option, just in case (this wouldn't explain why it works on Simulator though). Thanks for your help!
0
0
676
Dec ’23
How exactly do I get push tokens from a Live Activity that was started remotely?
In iOS 17.2+, we have a new feature that lets you use a push notification to start a Live Activity. The docs mention this: While the system starts the new Live Activity and wakes up your app, you receive the push token you use for updates. How exactly does this work? I don’t see any listeners/delegate methods that trigger when you receive a start event. Since I need to extract the push tokens from a specific instance, how do I get that instance? I can call Activity<MyType>.activities to see all running Live Activities, but assuming my end user has multiple instances running, how do I locate the instance that was started remotely?
2
0
903
Dec ’23
DeviceTokenNotForTopic
Some users couldn't receive push notifications, and APNS returned a 'DeviceTokenNotForTopic' error. Upon validation using Apple's tool, I found that some tokens are identified as VoIP push tokens, and some as Live Activity (LA) push tokens. When attempting to send a normal alert push using these VoIP/LA push tokens, it didn't work and returned a 'DeviceTokenNotForTopic' error. These tokens were obtained from Apple's delegate function 'didRegisterForRemoteNotificationsWithDeviceToken.' It's unexpected to receive VoIP/LA push tokens from this event, but this issue is occurring, and I've observed it specifically in iOS 17 users. This problem is not universal and is happening only for some users. Please take note that our app support VoIP Push, Live Activity Push and Normal Push notification. Could this be an iOS 17 bug? Any advice on this matter would be appreciated. Thanks.
3
0
2.5k
Dec ’23
Delay in APNS push after device move from offline to online.
We send multiple pushes while the device is offline and when we get back online we expect to get the last one. Our understanding is that Apple store only the last push and it will be immediately delivered when we get back online. But in some cases we are not receiving this last push when we come back online. strange part is if we send one more push we receive the missed one and the last push we send.
0
0
302
Dec ’23
location push service extension
I have recently been approved for the location push service extension. I do not have as much experience working directly in swift. I am trying to Implement so that when this Location Push Notification is received by the device it responds to the server with the current location. I have the proper APNS set up and have already been approved. Is there a step by step guide to help implement this feature.
2
0
653
Dec ’23
"Invalid Certificate Signing Request" error prevents certificate renewal on Apple Push Certificates Portal site
When attempting to renew a certificate after December 18, 2023, an error may be displayed, preventing the renewal of the certificate. It seems that repeating the process multiple times can occasionally lead to success, indicating that there is no issue with the CSR file. This occurrence has been observed in multiple MDM services, including Intune, Work Space One, and various other MDM vendors, suggesting a malfunction with Apple's servers. We hope that this issue will be promptly resolved and fixed. Although unrelated to the previous issue, when pressing "Manage Certificates," it redirects back to the login screen instead of returning to the certificate list page. Please fix this so that it returns to the certificate list page.
7
1
2.4k
Dec ’23
About ports to open to communicate with APNs
I'm an engineer at an MDM vendor. MDM push to devices via Apple Push Notification Service (APNs). According to the document below, port 5223 needs to be opened in order for the device to communicate with APNs. https://support.apple.com/ja-jp/guide/deployment/dep2de55389a/web https://support.apple.com/ja-jp/102266 https://support.apple.com/ja-jp/HT210060 Does this port need to be open for both in and out? Or should I only open out? in : APNs → iOS Device out: iOS Device → APNs
0
0
339
Dec ’23
Remote (background) notifications not arriving on macOS
I have an iOS and native macOS app that is configured to receive remote (background) notifications. I've verified that the background notifications are being received on iOS. I'm sending the notifications from my server, and my app also receives CloudKit notifications on iOS. But neither of these is received on macOS. I've found two recent discussions that indicate that other users are experiencing this problem: https://stackoverflow.com/questions/74868553/apple-push-notifications-arriving-on-macos-but-not-in-the-application-itself https://github.com/raivo-otp/macos-receiver/issues/15
2
0
522
Dec ’23
Enhancing 3rd Party Alarm Clock Apps on iOS: A Call for More Flexibility and User Control
Hello Apple Community, I am writing to discuss a limitation I’ve encountered with third-party alarm clock apps on iOS. As it stands, these apps are unable to function like the native Clock app, primarily due to the restrictions imposed by the operating system. Currently, third-party alarm apps rely on standard local notifications, which fire once and then cease. This means that if a user misses the initial notification, there’s no backup mechanism to ensure they are alerted. This is a significant drawback for users who rely on these apps to manage their time effectively. Moreover, some apps have found a workaround by playing a silent sound in the background to keep the app active. However, this method is not only against Apple’s guidelines but also drains the device’s battery life. I propose that Apple consider allowing third-party apps to push notifications from the background in an alarm style, with clear permissions granted by the user. This would enable users to clearly define acceptable notifications and specify an alarm-like display, providing a more personalized and effective alarm experience. By implementing this change, Apple could greatly enhance the functionality and user-friendliness of third-party alarm clock apps, ultimately benefiting the end-users and developers alike. Because this alarm feature is so important for productivity and quick responses to critical events or triggers I'm trying to see how some concepts could be reimagined if we had a little more flexibility. Apple iOS has a feature called StandBy mode that activates when an iPhone is charging and positioned on its side. This feature can be thought of as a kind of smart display for your iPhone that offers fast access to different screens of glanceable information. Always-On Display: StandBy mode can keep the display on even when the phone is locked, which is useful for an alarm app. Users can glance at the time without having to unlock their phone w/ Low-Light Adaptation Customizable Screens: StandBy mode consists of screens that can be accessed by swiping horizontally on your iPhone’s display. This could allow an alarm app to display additional information, such as route, or weather warnings. Interactive Widgets: The widget screen in StandBy mode is interactive and customizable. I look forward to hearing your thoughts on this matter. Best regards, Phil Cutting
2
6
1.1k
Jan ’24