Hello,
I'm trying to use critical alerts on the CarPlay, but I'm facing couple of issues:
Sound of critical alerts is not played by the CarPlay's speakers (played by the iPhone's speakers)
Tapping on a critical alert doesn't open the app like other notifications.
Critical alerts of the app are always shown if the CarPlay is connected, even if the app doesn't have the CarPlay entitlement.
didReceive is not called if the user taps on a notification on the CarPlay.
Any help would be greatly appreciated
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,
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.
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
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?
I'm working on implementing Apple Wallet passes using background push notifications.
My server successfully sends the push notification using APNs. The response from the server is HTTP/2 200, and the device receives the push — I can confirm this from device logs.
However, the device logs show the following error:
"Failed to parse JSON message payload for topic "
"Unable to deserialize JSON message payload"
My payload is below 2 payload.
//string payload = "{"aps":{"content-available":1}}";
string payload = JsonConvert.SerializeObject(new
{
aps = new Dictionary<string, object>
{
{ "content-available", 1 }
}
});
string curlArgs = $"-s -o nul -w \"%{{http_code}}\" " +
$"--data-binary \"{payload}\" " +
$"-H \"apns-topic: {bundleId}\" " +
$"-H \"apns-push-type: background\" " +
$"-H \"apns-priority: 5\" " +
$"-H \"content-type: application/json\" " +
$"-H \"authorization: bearer {jwt}\" " +
$"--http2 https://api.push.apple.com/3/device/{token}";
I’ve confirmed that:
The device has the Wallet pass installed.
The apns-topic header is set to my passTypeIdentifier.
The apns-push-type is background and apns-priority is 5.
Steps to Reproduce:
Install Wallet pass on iOS device.
Send background push to device using the above payload.
Observe the device logs using Console.app or log stream.
See error: unable to deserialize JSON message payload.
Is there a specific payload format expected for Wallet passes? Or any additional fields required in the push payload to avoid this deserialization error?
after my phone receives a notification, the screen stays on. i Waited 15 minutes and did not go off (fully lid) battery drained 5%. Always on display was set to OFF. Restarting the phone solved the issue, but home & loch screen has been my No..1 battery use since I have the iPhone 16 (2 weeks). never saw that app using battery in the previous 10 year of iPhone use. My new iphone 16 pro max does not appear to have much more battery life than my previous 12 pro max with battery cap at 83%
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
Subject: Seeking Native iOS Solution for Push Notification Acknowledgement and User Interaction Tracking
I’m exploring whether there is a native solution in iOS to track the confirmation/acknowledgement of a received push notification on the device, as well as any user interaction with it (e.g., tapping or dismissing the notification). Although I’ve come across multiple discussions on this topic suggesting that it’s not possible, I’d like to know if there have been any recent updates or enhancements in iOS that provide this capability.
Has anyone found a reliable approach or workaround for this? Any insights would be appreciated!
Thanks!
Our team had previously encountered deprecation warnings for applicationIconBadgeNumber, but while working with iOS 18.0.1 and Xcode version 16.1, I no longer see these warnings. Has the deprecation been reversed, or do we need to address it on our end? Please provide insights on whether the deprecation still applies, as there are no warnings in Xcode for that API and action items on the integrators.
Topic:
App & System Services
SubTopic:
Notifications
Currently, our company server is using the push service by calling APNS through the p8 certificate.
In this process, our server does not have a CA certificate or SSL certificate in use.
Only the p8 certificate is installed and only performs the role of calling APNS.
If it is used like this, is there no need to update the CA certificate separately?
Or do I have to apply a new SSL certificate and add the CA to it?
Can someone help me plz?
Topic:
App & System Services
SubTopic:
Notifications
I would like to do exactly this but the API doens't seem to allow it. Was wondering if there were any creative workarounds? Basically, I have a reminder app that needs to send reminders at a certain time each day (there are several of these reminders per day). Each reminder has a couple of follow-ups scheduled at 5 min intervals.
If a user takes action on the task before the reminder is sent however, I would like to unschedule that notification (and follow ups) until the next day. The unscheduling part is easy, but there seems to be no reliable way to re-schedule it for the next day and continue repeating.
Looked into background tasks and they don't seem intended for these purposes nor do they seem reliable. The user isn't guaranteed to take action on notifications nor open the app within a 24-hour period after they have taken action on their task.
Hello. I'm currently implementing Apple Notification v2 to prepare for refunds for in-app purchases, but I'm not receiving requests from Apple servers to my backend server.
I've applied HTTPS (TLS 1.2) and correctly registered production/sandbox notification URLs on App Store Connect.
After requesting a test notification, when I check the status of testNotificationToken, I receive an UNSUCCESSFUL_HTTP_RESPONSE_CODE as follows:
{"signedPayload":"......":[{"atteptDate":1752128001970,"sendAttemptResult":"UNSUCCESSFUL_HTTP_RESPONSE_CODE"}]}
The endpoint for receiving notifications is set to accept POST requests with application/json format, and it responds with 200 (OK) without any content. However, Apple notifications are not coming through.
Could anyone help me with this issue?
Topic:
App & System Services
SubTopic:
Notifications
Push-notification token is properly requested and displayed from the iOS simulator / xcode, but not from the release in the AppStore... Both popups for permission (push-notifications and critical alert) appear and can be confirmed, but no callback takes place...
Topic:
App & System Services
SubTopic:
Notifications
Hi there,
We’re using APNs Push delivery metrics, which provide a breakdown including metrics like Received by APNs, Delivered to Device, and Discarded - Token Unregistered.
To track unregistered tokens on our end, we also monitor the 410 error responses from APNs, which typically indicate that a token is no longer valid. However, we’ve noticed a discrepancy: the number of 410 errors we receive is much lower than the Discarded - Token Unregistered count shown in the APNs console.
Is this difference expected? Specifically, does APNs sometimes know that a token is unregistered but still return a success status to us when we attempt to send a push to that token?
Thank you for any insights you can provide!
I tried below at 2:00 PM on 21/01/2025(JST).
Apple Push Notification service server certificate update
I followed above,
a new server certificate: "SHA-2 Root : USERTrust RSA Certification Authority certificate" was added to my push server, but a certificate error occurred and push notifications could not be sent.
So I refered this article,Instead of connecting via DNS name resolution at api.development.push.apple.com,
I fixed api.development.push.apple.com to "17.188.143.34" in /etc/hosts,
I could push notifications with the new server certificate.
(I got this IP(17.188.143.34) from this airtcle)
From this, I suspect that Apple had not yet updated the APNs certificate (CA) for the Sandbox environment as of 2:00 PM on January 21, 2025 (JST).
Was the update published as scheduled?
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
User Notifications
PushKit
Push To Talk
Hi when setting the language to iOS 6 my app crashes on this piece of code:
func registerForPushNotifications() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
print("Permission granted: \(granted)")
guard granted else { return }
self.getNotificationSettings()
}
}
It has to do with the requestAuthorization
When I restart the app it crashes immediately. This is because I had already made a choice for this.
When I change the language back to swift 5 it works fine again.
Removing the self.getNotifcationSettings has nothing to do with it.
Also tried to add @MainActor to the function.
This is the tread where it crashes on:
Thread 7 Queue : com.apple.usernotifications.UNUserNotificationServiceConnection.call-out (serial)
Does anybody have a idea how to fix this?
Topic:
App & System Services
SubTopic:
Notifications
Hello everyone.
I'm trying to add a lifetime for push notifications via apns-expiration for my application.
With the Internet turned on, push notifications come, that's ok.
With the Internet turned off, as I noticed, only the last push with the badge installation on the application icon comes.
That is, the logic is that a text push with text is sent, then after N time the next push to the same device with the badge installation.
I would like to receive a text push after turning on the Internet.
Topic:
App & System Services
SubTopic:
Notifications
Hey there,
i implemented live activity in my app and iam trying to start the live activity from push notification, updates works fine even when the app is in background but starting the activity creating issue mostly on background and kill mode when i check the delivery of live activity on cloudkit console it says stored for device power considerations.
anyone having the same issue ?
I keep getting 401 Unauthorized error when fetching Apple's public keys.
In [14]: print(f"Error fetching public keys: {response.status_code} {response.text}")
Error fetching public keys: 401 Unauthenticated
I've verified that the Key ID, Issuer ID, and private key file are all correct, with the private key having admin access. The server time is correctly set to UTC. Given this, I can't identify what might be causing the issue. Any insights?
def generate_apple_developer_token():
# Load the private key in PEM format
with open(PRIVATE_KEY_FILE, 'rb') as key_file:
private_key = serialization.load_pem_private_key(
key_file.read(),
password=None,
backend=default_backend()
)
# JWT header
headers = {
"alg": "ES256",
"kid": KEY_ID,
"typ": "JWT"
}
# JWT payload
payload = {
"iss": ISSUER_ID,
"iat": int(datetime.utcnow().timestamp()),
"exp": int((datetime.utcnow() + timedelta(minutes=10)).timestamp()),
"aud": "appstoreconnect-v1",
}
# Encode the header and payload as base64
header_base64 = base64.urlsafe_b64encode(json.dumps(headers).encode()).decode().rstrip("=")
payload_base64 = base64.urlsafe_b64encode(json.dumps(payload).encode()).decode().rstrip("=")
# Concatenate header and payload
message = f"{header_base64}.{payload_base64}".encode()
# Sign the message using ECDSA with SHA256
signature = private_key.sign(
message,
ec.ECDSA(hashes.SHA256())
)
# Convert the DER-encoded signature to raw format (r and s concatenated)
der_to_raw_ecdsa_format = lambda der: der[4:36] + der[-32:]
# Convert the signature to raw format (64 bytes)
signature_64 = der_to_raw_ecdsa_format(signature)
# Base64 URL-encode the signature
signature_base64 = base64.urlsafe_b64encode(signature_64).decode().rstrip("=")
# Concatenate header, payload, and signature to form the JWT
jwt_token = f"{header_base64}.{payload_base64}.{signature_base64}"
return jwt_token
def get_apple_public_keys():
try:
# Generate a fresh JWT
developer_token = generate_apple_developer_token()
# Set up headers with the authorization token
headers = {
"Authorization": f"Bearer {developer_token}"
}
# Fetch the public keys from Apple
response = requests.get('https://api.storekit.itunes.apple.com/in-app-purchase/publicKeys', headers=headers)
# Log the response if it's not successful
if response.status_code != 200:
print(f"Error fetching public keys: {response.status_code} {response.text}")
response.raise_for_status() # Raises an exception for 4xx/5xx errors
# Parse and return the public keys
response_data = response.json()
keys = response_data.get('keys')
if not keys:
print("No 'keys' found in the response from Apple.")
return []
return keys
except requests.exceptions.RequestException as e:
print(f"Error fetching Apple's public keys: {e}")
return []
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Store Server Notifications
App Store Server API
I have a database in CloudKit, where the host share (using CKShare) a record to participants. The record is in her private database, but for the participants is in their shared database. How do I send push notifications to everyone when a new child record is created?