I invoked the getNotificationSettingsWithCompletionHandler method of UNUserNotificationCenter on multiple test devices. After dismissing the notification permission request dialog (without explicit denial), the returned UNNotificationSettings object showed inconsistent authorizationStatus values across OS versions:
**iOS 18: Returns UNAuthorizationStatusNotDetermined
iOS 14.2:** Returns UNAuthorizationStatusDenied
Where can I find official Apple documentation explaining this behavioral discrepancy between system versions?
Notifications
RSS for tagLearn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello,
We are currently facing a persistent issue where Apple Push Notifications (APNs) are no longer being delivered to devices. This is not an intermittent problem — push notifications have completely stopped working. We are using PushSharp.Apple (Version 4.0.10.0) to send the notifications.
Current Behavior (Failing):
Every notification request appears to be processed successfully from the server side.
However, the APNs client receives a 0-byte response, and the server closes the connection.
Devices do not receive the notifications at all.
Logs from Current (Failing) State:
APNS-Client[1]: Connected (Batch ID=1)
APNS-Client[1]: Sent Batch, waiting for possible response...
APNS-Client[1]: Received 0 bytes response...
APNS-Client[1]: Server Closed Connection...
APNS-Client[1]: Disconnected (Batch ID=1)
For Reference – Successful Log From Earlier (When Notifications Worked):
APNS-Client[1]: Connected (Batch ID=1)
APNS-Client[1]: Sent Batch, waiting for possible response...
APNS-Client[1]: Received -1 bytes response...
Push Notification Successfully Sent to Device
Any help, suggestions, or experience with similar issues would be greatly appreciated.
Thanks!!!
I downloaded the .crt file to take the following steps. Could you please give me a guide on how to actually apply the file to the server?
Upload only files to a specific path on the Linux server.
keytool -import -alias cacert -file ca.crt -keystore client.truststore.jks
Is it possible to just apply it with the above command?
Please confirm.
thank you
Topic:
App & System Services
SubTopic:
Notifications
Hi team,
I'm developing a feature that's collecting the device locations for home security app.
We've been following
https://developer.apple.com/documentation/corelocation/creating-a-location-push-service-extension
apns-push-type set to location.
apns-priority set to 5.
during testing, we found that the device's notification extension cannot be triggered after device going into lock screen for 10 mins.
Wonder should we set the priority to 10? Thanks!
I'm experiencing issues with didRegisterForRemoteNotificationsWithDeviceToken not being called on iOS 18.1.1. Here's what I've tried:
Basic Setup:
Properly configured UNUserNotificationCenter
Requested permissions with requestAuthorization(options:)
Registered for remote notifications with registerForRemoteNotifications()
Environment:
Xcode 16.3
iOS 18.1.1 (physical device)
Firebase (tried with and without it)
Troubleshooting:
Verified provisioning profile includes Push Notifications
Confirmed APNs certificate is valid
Disabled Firebase's method swizzling
Tested on a clean project (works fine)
Checked device logs (no relevant errors)
Code Snippet:
// In AppDelegate.swift
public func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
let tokenString = tokenParts.joined()
print("📱 Device Token: \(tokenString)")
// Store the token for your backend
UserDefaults.standard.set(tokenString, forKey: "deviceToken")
// Send to backend
Task {
do {
try await APIService.shared.setDeviceToken(tokenString)
} catch {
print("❌ [AppDelegate] Failed to send device token to backend: \(error)")
}
}
}
public func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// IMPORTANT: First handle push notification registration
UNUserNotificationCenter.current().delegate = self
// Request notification permissions
self.requestNotificationPermissions()
// Register for remote notifications
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
return true
}
private func requestNotificationPermissions() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in
guard granted else {
print("❌ Notification permission not granted")
return
}
print("✅ Notification permission granted")
}
}
Hey there,i start a live activity,but it not works, and sometime it can work;
apns-unique-id 46445cfa-1bf6-0f63-5ea3-2afa53e02b0d
and it show that "
2025年5月19日 GMT+8 15:13:25.836
received by APNS Server
2025年5月19日 GMT+8 15:13:26.244
discarded as application was not registered"
but i did not know how can i do;
thanks for you help
Good morning all!
We are facing a specific case dealing with push notifications to iOS devices.
In my scenario:
I turn off my device's internet
Send multiple push notifications via server using Firebase.
I turned ON my device's internet again.
I only see the last push notification I sent.
This is an expected scenario?
There is any documentation that supports this statement?
Thank you all!
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Store Server Notifications
Notification Center
User Notifications
APNS
Hello,
I have a question regarding the replacement of the APNs authentication key (.p8) in a Firebase setup for push notifications.
Currently, my app uses an APNs authentication key from the original Apple Developer account. However, we are in the process of transferring app ownership to a new Apple Developer account, which will require generating a new APNs authentication key and updating it in Firebase.
My concerns are:
Impact on Existing Device Tokens:
If we replace the existing .p8 key with a new one generated from the new developer account, will the existing APNs device tokens remain valid, or will they need to be reissued?
Push Notification Delivery:
Will Firebase still be able to send push notifications to devices that were registered with the previous APNs authentication key after the key is replaced?
Steps for a Smooth Transition:
Are there any best practices or additional steps we need to follow to ensure uninterrupted delivery of push notifications during and after the key replacement?
Any insights or guidance from the Apple Developer team or community would be greatly appreciated.
We have just been granted access to the com.apple.developer.usernotifications.filtering entitlement, and are following the documented steps for handled E2EE VOIP notifications listed here: https://developer.apple.com/documentation/callkit/sending-end-to-end-encrypted-voip-calls
1 - A user initiates a VoIP call on their app. Their app then sends an encrypted VoIP call request to your server.
We do exactly this, Alice calls Bob from her app, sending a notification to our servers.
2 - Your server sends the encrypted data to the receiver’s device using a regular remote notification. Be sure to set the apns-push-type header field to alert.
We do exactly this, our server send on a notification to APNS with the apns-push-type header set to alert, destined for Bob.
3 - On the receiver’s device, the notification service extension processes the incoming notification and decrypts it. If it’s an incoming VoIP call, the extension calls reportNewIncomingVoIPPushPayload(_:completion:) to initiate the call. It then silences the push notification (see com.apple.developer.usernotifications.filtering).
I try to do exactly this. The notification is received by the NSE on Bob's device, which decrypts it and then notices it is a VOIP call from Alice. It prepares a dictionaryPayload with the decrypted data and then calls reportNewIncomingVoIPPushPayload(_:) async throws. This throws an NSXPCConnectionInterrupted error, which when logged shows as below:
Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.callkit.notificationserviceextension.voip" UserInfo={NSDebugDescription=connection to service named com.apple.callkit.notificationserviceextension.voip}
The only difference I can see to the documentation is that I am working in an asynchronous context so am using the asynchronous version of the method, but I don't imagine this should cause an issue?
I then supress the notification as documented and this works correctly.
Does anyone have any ideas why I am getting this error when calling reportNewIncomingVoIPPushPayload(_:) async throws?
SIM toolkit DISPLAY message is not displayed.
Use case:
SIP MESSAGE SMS Deliver (SC to MS) - 200 OK
SIP MESSAGE RP-ERROR (MS->NW):111:Protocol error, unspecified
Concatenated messages (2pcs) are resent over NAS and Deliver reports received from UE.
User is not notified of SIM toolkit message.
Topic:
App & System Services
SubTopic:
Notifications
Facing issue while sending push notification through the application. The APNs certificate is valid.
Below is the error log.
System.AggregateException: One or more errors occurred. ---> PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult)
at System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult)
at System.IO.Stream.<>c.b__53_1(Stream stream, IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise1.Complete(TInstance thisRef, Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at PushSharp.Apple.ApnsConnection.<SendBatch>d__21.MoveNext() --- End of inner exception stack trace --- at PushSharp.Apple.ApnsServiceConnection.<Send>d__2.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult) at System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult) at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_1(Stream stream, IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise1.Complete(TInstance thisRef, Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at PushSharp.Apple.ApnsConnection.d__21.MoveNext()
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.d__2.MoveNext()<---
Topic:
App & System Services
SubTopic:
Notifications
The system calendar when showing a calendar event shows a relative timestamp on the notification versus all other apps which have a timestamp of when the notification was sent.
Is there a way to set the timestamp to be relative? I am currently working on a calendar app and we should be able to use the same system that apple uses for its own calendar.
Post about this on stack overflow from someone else a few years ago
Hello, i'm facing issues, when trying to integrate push notification feature into my app. the following message is shown and I don't know how to fix it:
ExportArchive "Runner.app" requires a provisioning profile with the push notifications feature
(Encountered error while creating the IPA)
Thankful for any help! Best regards
Topic:
App & System Services
SubTopic:
Notifications
After my membership was renewed (auto-payment was rejected, and my account was manually paid), my app stopped receiving notifications I thought was an invalidation by membership but after some days, my app kept not receiving notifications.
I just recreated a new key for my app, (I hope it solves the problem)
My question is, do I need to make another change to my account to reenable services?
Topic:
App & System Services
SubTopic:
Notifications
I have a “1” above the setting app on my iPhone. However when I open settings there is no notification that shows up. I have tried force restarting and done the beta updates as they release however nothing works to got rid of it. What can I do?
Topic:
App & System Services
SubTopic:
Notifications
Hi Everyone,
I noticed that applicationIconBadgeNumber has been deprecated in iOS17. While there's a new method to set the badge number using setBadgeCount(_:withCompletionHandler:), I couldn't find a way to retrieve the current value.
Previously we used to call UIApplication.shared.applicationIconBadgeNumber, to get the current value, which is deprecated now.
Does anyone know how to get the current badge count?
Thanks!
Topic:
App & System Services
SubTopic:
Notifications
when I implementation the UNUserNotificationCenterDelegate
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
var status = ""
if (UIApplication.shared.applicationState == .active) {
status = "active"
} else if (UIApplication.shared.applicationState == .background) {
status = "background"
} else if (UIApplication.shared.applicationState == .inactive) {
status = "inactive"
}
completionHandler()
}
I find that UIApplication.shared.applicationState == .background this case can not execute when application is in background。
why applicationState is inactive not background?
I'm observing that when a silent push notification is sent to our app, is is started up in the background for 30 seconds before being suspended until the app is launched by the user. This causes data to persist from the silent push notification to the user app launch.
I couldn't find documentation on this behavior for silent push notifications, and was wondering if it's possible to have the app terminate after handling the silent push notification. Is there documentation on the general flow of silent push notifications as well?
I'm able to handle the edge cases if the app has to be suspended until user launch, but just want to confirm that this is the expected behavior before I go about handling it this way.
We would like to better understand the discrepancy between a Push To Start and the subsequent Updates where I see a number of recipients drop greatly.
Our assumption is that this is a result of the end user not clicking the "Allow" prompt when a push to start widget is shown on the screen for the first time, but we currently do not have a way to listen to the user's choice when prompted.
Is there any way of tapping into this, to determine if this is in fact where the variance is coming from, or if there is actually just a problem with the request to retrieve the update token from our end?
Hello Everyone,
I somehow missed to renew the APNS Certificate,
I am new to Apple Ecosystem, I can not see the expired or any Certificates under
Certificates, Identifiers & Profiles
Can anyone help me with this!