Notifications

RSS for tag

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

Notifications Documentation

Posts under Notifications subtopic

Post

Replies

Boosts

Views

Activity

Notification Received in Kill Mode but No Method Invoked in iOS
Hello Apple Developer Team, I am facing an issue with remote notifications in my iOS app. When the app is in a terminated (kill) state, notifications are successfully received by the device, but none of the app's handlers (like _firebaseMessagingBackgroundHandler in Flutter) are invoked. This is impacting our ability to process silent notifications or perform background tasks reliably when the app is not running. Steps to reproduce: Send a remote notification with content-available: 1 in the payload. Confirm the notification is received by the device while the app is in kill mode. Observe that no background or foreground notification methods are triggered in the app. Expected Behavior: The app should invoke the background handler to process the notification payload, even in a terminated state. Observed Behavior: The notification is delivered to the device, but no app-level processing occurs because none of the methods are triggered. Can you please confirm if this is the intended behavior due to iOS limitations, or if there is a configuration or alternative solution to allow background handlers to execute in such scenarios? Any guidance or clarification would be highly appreciated. Thank you!
1
0
642
Nov ’24
Silent push notifications not working on some iOS devices
I send APNs notifications to my devices with the CloudKit dashboard. I test with two devices; Device with Silent Push Working Successfully: iOS version 16.5.1 (c), Model iPhone Xs Silent Push Failed Device: iOS version 15.3.1, Model iPhone Xr Normal alert notifications work successfully on both devices. But I can't see any log in my project even though silent push is sent successfully on one device. What I've Checked: content-available is set to 1. My app is not in kill state, it is in foreground or pending in the background. When I send simple notifications, I can see logs in my swift project and notifications on physical devices without any problem. No, my certificate has not expired and if there was a problem with it, I would not be able to see the normal notifications. My phone is not in power saving mode and the “Background App Refresh” option is turned on in the app's settings. Both devices in charging state. App capabilities: Background Modes is enabled with Remote Notifications, Background Fetch, Background Processing. CloudKit Dashboard After Sending Silent Push: My AppDelegate Class In Swift Project: import SwiftUI import UIKit import UserNotifications class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in if granted { DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } } } return true } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) } let token = tokenParts.joined() print("Device Token: \(token)") } func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { print("Failed to register: \(error)") } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { logInfo("Received Push Notification: \(userInfo)") if let aps = userInfo["aps"] as? [String: AnyObject], aps["content-available"] as? Int == 1 { logInfo("This is a silent push notification") //DO SOME WORK completionHandler(.newData) } completionHandler(.newData) } }
2
0
489
Nov ’24
userNotificationCenter(_:willPresent:withCompletionHandler:) Triggered Twice in iOS 18
I'm encountering an unexpected issue in my app since upgrading to iOS 18, and I’m wondering if anyone has found a solution or workaround. The Problem: The userNotificationCenter(:willPresent:withCompletionHandler:) method is being triggered twice whenever a push notification arrives while the app is in the foreground. Additionally, application(:didReceiveRemoteNotification:fetchCompletionHandler:) is also being triggered once during the same notification event. This redundant triggering is causing inconsistent behavior and double-processing of notifications, which is obviously problematic for my use case. The exact flow looks like this: userNotificationCenter(:willPresent:withCompletionHandler:) — called twice. application(:didReceiveRemoteNotification:fetchCompletionHandler:) — called once. Has anyone else experienced this behavior specifically in iOS 18? Is this a known issue with the new version? This issue is affecting how we handle notifications in a major way, and I’m hoping there's a more fundamental fix or explanation for this behavior in iOS 18.
1
0
351
Nov ’24
I would like to know why I didn't receive a VoIP notification.
We have modified the program as we received in the previous(thread 764479) issue. Our program works very well and the notification problem has been almost solved in the test. Then, we tested it in the user's environment. At that time, one of the three iPhones stopped receiving notifications. After 10 minutes, VoIP notifications were received again. This device received PUSH notifications even when VoIP notifications did not come. We must explain to the user why this incident occurred. We would like to know if these three notifications were sent correctly to the device. Also, is there any other way for us to deal with this other than improving the network? [APNS LIST]Nov. 20th could not receive(failed) 15:06:13 5793987C-D1A4-811F-917F-87DD7F5083B3 15:07:09 667E0A2F-43B5-37FC-2F2A-45A6C27EFC34 15:19:31 1353DF78-519E-B1DC-82B7-8B890E59FE37 received(success) 15:04:09 19CC1937-533A-9AF4-9472-41C839E461D7 15:35:00 CD23AC57-6EC7-4523-941F-B103EDB4DEFB
0
0
325
Nov ’24
iOS 18 - Push Notifications Not Working
We at Anywayanyday (Apple ID 424980622) utilize push notification technology for our users to enhance customer scenarios. Recently (after the launch of OS 18 update, end of September '24) we started to observe that our customers were not receiving notifications on devices with OS 18+. In their systems we see that sending a message via transport has been done, but no notifications are reaching the client. In the system it is visible that the device token is fresh and working. Could you please tell us what steps we should take to fix the functionality of push notifications? Thanks
2
0
826
Nov ’24
Notifications
We've had reports that since upgrading to iOS 18.1.1, wallet pass notifications (on the lock screen) now display "Nearby" instead of the Departure time,. Has anyone else experienced this issue? There doesn't seem to be any documentation around it. Thanks
0
1
370
Nov ’24
Departure Time no longer displayed on lock screen notifications for Passes (iOS 18.1)
With the relevantDate field deprecated for Apple passes as of 18.1 https://developer.apple.com/documentation/passkit_apple_pay_and_wallet/pkpass/1618776-relevantdate, boarding pass notifications on the lock screen no longer seem to display the departure time. Is there a way to show this again? Would semantic tags (Semantics.currentDepartureDate) or the new PkPass.releaseDates field help?
3
0
420
Dec ’24
How to Decode In-App Purchase Base64-Encoded Receipt to Extract Transaction ID Without Using the Deprecated verifyReceipt Endpoint?
I need to decode a Base64-encoded receipt from an In-App Purchase and extract the transaction ID from it. However, I want to avoid using the verifyReceipt endpoint since it is deprecated. Can anyone guide me on how to achieve this manually? Are there any specific libraries, steps, or code samples I should follow to parse the receipt data and retrieve the transaction ID? Any help or insights would be greatly appreciated!
0
0
401
Dec ’24
iOS 18.1.1 didRegisterForRemoteNotificationsWithDeviceToken not called
I have to device, one is iOS 17.0.3, the other is iOS 18.1.1. In iOS 17.0.3, everything just goes fine, but iOS 18.1.1 'didRegisterForRemoteNotificationsWithDeviceToken' and 'didFailToRegisterForRemoteNotificationsWithError' never called. I am sure I already called 'registerForRemoteNotifications' method in Appdelegate, Singning & Capabilities's Remote notification is also checked. I use Firebase, also add FirebaseAppDelegateProxyEnabled = NO in my info.plist. Someone can tell me why? Think u for ur answer.
1
0
407
Dec ’24
Xcode16.1&iOS18.1.1 Debugging App, unable to respond “didRegisterForRemoteNotificationsWithDeviceToken” delegation
I am an iOS development engineer. Recently, I updated the Xcode version to 16.1 (16B40) and updated my debugging device (iPhone 15) to iOS 18.1.1. However, I found that I could not respond to the delegate method. I confirmed that my code, certificate, Xcode settings, and network environment had not changed. Simply executing application.registerForRemoteNotifications() in func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool did not receive a response(didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError ). In the same environment, when I switched to another device for debugging (iOS 17.0.3), the delegate method would respond. I really don't know what to do, I hope someone can help me, I would be very grateful. Please note: Everything is normal when using devices before iOS 18.1.1 version
3
0
666
Dec ’24
Does Firebase Push Notification Service Need New Certificates Due to APNs Update
Hi, With the upcoming changes to the Apple Push Notification service (APNs) server certificates — including the SHA-2 Root: USERTrust RSA Certification Authority certificate update — I wanted to clarify if we need to take any action with Firebase Cloud Messaging (FCM). Since we’re using FCM to send push notifications to iOS devices, does Firebase also need to update its server certificates in response to these changes, or will Firebase handle the updates automatically? We understand that Apple recommends updating our Trust Store to include the new certificates for APNs, but we’re unsure if any action is needed on our end for FCM specifically. Thanks in advance for the clarification!
7
4
15k
Dec ’24
No red badge on mail 18.2 (BETA)
I am on iOS 18.2 Beta. Since the new Apple Intelligence update, and the new layout of Apple Mail, I am not getting the red badge on my mail app, even though it is selected in the settings. When I go into my email, I have lots of unread messages there... but no red badge to let me know.
1
0
300
Dec ’24
Push Notification towards APP that don't belongs to my developer account
Hi All, i read the documentation regarding APN and related API, but i didn't understand if, from my server, i can send push notification to every application or only to applications that belongs my developer account. I try to better explain my needs: the enviroment regards voip communications, my sip server is asterisk based and i want to wrote a script to wakeup device just before send a call to it. On mobile device, i use a generic app taken from the apple store. At the moment i am using linphone. When linphone starts, it registrer with APNs and send to the asterisk server pn-* data. In the pn-params it sends the teamid (ABCD1234) and bundleid (org.linphone.phone). In my script, i have taken the teamid/bundleid retrieved from the linhpone app, i have generated a Key from my developer account and used it to authenticate to APN, but i got always InvalidProviderToken. So my question is: is it possibile to send notification to application that i didn't own? or the InvliadProviderToken has nothing related to this and simply i am doing something wrong with key authentication?
1
0
202
Dec ’24
What are the exact conditions for '429 TooManyProviderTokenUpdates' in APNs when managing multiple TEAM_ID and KEY_ID?
Hi, We are building a system that integrates with APNs using the Token-Based Authentication method. While testing, we encountered the 429 TooManyProviderTokenUpdates error and would like clarification on the exact conditions that trigger this response. Our Testing Scenario: Private Key: We keep the same Private Key constant across requests. TEAM_ID and KEY_ID: For testing purposes, we change the TEAM_ID and KEY_ID for every JWT we generate. Requests: Each generated JWT is used to call the /3/device/{token} API endpoint. Observed Behavior: When we test with different TEAM_ID and KEY_ID combinations, we initially receive 403 InvalidProviderToken, which is expected because the TEAM_ID and KEY_ID combinations are invalid. However, if we change the TEAM_ID and KEY_ID and make multiple calls (e.g., more than two within 20 minutes), we start receiving 429 TooManyProviderTokenUpdates. If we switch to a different IP address (via VPN) after receiving the 429 error, we revert to receiving 403 InvalidProviderToken. Our Use Case: We are building a system where multiple server clusters handle multiple apps (some under the same Apple Developer account, others under different accounts). Each server generates JWTs for requests to the APNs /3/device/{token} API. Our Questions: What specific conditions cause the 429 TooManyProviderTokenUpdates error? Does APNs monitor token updates at the level of TEAM_ID and KEY_ID, or does it consider additional factors such as the originating IP address or shared infrastructure? How does APNs handle frequent changes in TEAM_ID and KEY_ID within a single server or cluster? Is there any documentation or guidance on managing JWTs effectively in a distributed system with multiple apps and servers? Does APNs limit JWT updates based on IP address or API endpoint usage across multiple apps sharing the same Apple Developer account? We would greatly appreciate any clarification on these points and guidance on best practices for managing JWTs in a multi-cluster environment. Thank you!
1
0
277
Dec ’24
Reasons for the prompt "application is damaged and cannot be opened. You should move it to trash"
We have an application which keeps throwing the error "application is damaged and cannot be opened. You should move it to Trash" We have checked the following possible root causes: Codesign of the application using the codesign command Notarization of the application using the spctl command Executable permissions Checked for the presence of "com.apple.quarantine" flag for the application using xattr -l <path to executables" None of the above listed items seemed to be a problem and are as expected. Can you please help us understand what could cause this issue and how to resolve this without recommending an uninstall/reinstall of the application?
3
0
319
Dec ’24
APNs certificate authority?
I manage apps and servers on behalf of several customers. Recently they all started getting a message from Apple that says, "The Certification Authority for APNs is changing". I don't understand how or if this affects me. My servers are all hosted on Amazon EC2 instances. I have never had to install any specific certificate for APNs to work. Is this new CA something that I can expect my servers to receive automatically as part of their system updates? If not, how do I install it?
2
0
488
Dec ’24
delphixe apns Remote Push error:Connection Closed Gracefully
function TFormMain.HttpPost(IdHTTP1: TIdHTTP; sJsonData, sUrl: string): string; var jsonToSend: TStringStream; begin try IdHTTP1.HTTPOptions := IdHTTP1.HTTPOptions + [hoKeepOrigProtocol]; //必须有这行才使设置协议版本生效 IdHTTP1.ProtocolVersion := pv1_1; IdHTTP1.Request.CustomHeaders.Values[':method']:='POST'; IdHTTP1.Request.CustomHeaders.Values[':path']:='/3/device/' + EditDeviceToken.Text; IdHTTP1.Request.CustomHeaders.Values[':scheme']:='https'; IdHTTP1.Request.CustomHeaders.Values['apns-push-type']:='background'; IdHTTP1.Request.CustomHeaders.Values['host']:='api.push.apple.com'; IdHTTP1.Request.CustomHeaders.Values['apns-topic']:='com.xxvar.erp'; IdSSLIOHandlerSocketOpenSSL1.SSLOptions.CertFile:='d:\WIN\APNS-cert.pem'; IdSSLIOHandlerSocketOpenSSL1.SSLOptions.KeyFile:='d:\WIN\APNS-key.pem'; IdSSLIOHandlerSocketOpenSSL1.ssloptions.method:= sslVSSLv23; IdSSLIOHandlerSocketOpenSSL1.ssloptions.Mode:= sslmBoth; with IdHTTP1 do begin IOHandler := IdSSLIOHandlerSocketOpenSSL1; HandleRedirects := True; //允许头转向 ReadTimeout := 5*60*1000; //请求超时设置 Request.ContentType := 'application/json'; //x-www-form-urlencoded Request.ContentEncoding := 'utf-8'; try jsonToSend := TStringStream.Create(UTF8Encode(sJsonData)); jsonToSend.Position := 0; //将流位置置为0 Memo1.Lines.Add('发送指令执行结果到集抄平台: ' + sJsonData); Result:= Post(sUrl, jsonToSend); Memo1.Lines.Add(Result);//Result := HTTPDecode(Post(sUrl, jsonToSend)); //接收POST后的数据返回 except on e: Exception do begin Memo1.Lines.Add('接口调用异常: ' + e.Message); jsonToSend.free; end; end; end; finally end; end;
1
0
296
Dec ’24