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

Ios18 CarPlay/BlueTooth issues
I recently updated my iOS operating system to the latest iOS18. Immediately after updating my CarPlay begin having issues. I began Troubleshooting and came up with some conclusions. If anyone can help that would be amazing. When NOT connected to carplay via cable, the Bluetooth works perfectly. When connected via cable to CarPlay the system is does not recognize Bluetooth. The phone begins to play through speakerphone, radio turns on and is playing in background. please help fix this issue. I can not have carplay not working along with Bluetooth in vehicle.
2
0
1.1k
Sep ’24
VoIP push notifications may not be received
Users of my app have reported that they are sometimes unable to receive Voice-over-IP (VoIP) push notifications when using a SIM. (There is no problem when using WiFi) VoIP push notifications were not received during the following period. Could you confirm diagnostic logs and could you please tell me why my app can't receive VoIP push? [diagnostic logs] https://drive.google.com/drive/folders/1gSAbr1Fy1SrjlmRXuAzoXqiaxnNbFhj8?usp=sharing [Problem period] 2024/06/17 05:34:59 - 2024/06/17 09:04:42 Number of times that the push server pushed and it received a normal APNs response: 31 Number of times that iPhone received pushes: 0 2024/06/17 23:05:03 - 2024/06/18 09:02:16 Number of times that the push server pushed and it received a normal APNs response: 192 Number of times that iPhone received pushes: 0 2024/06/15 00:35:56 - 2024/06/15 09:55:57 Number of times that the push server pushed and it received a normal APNs response: 138 Number of times that iPhone received pushes: 0
11
0
840
Jul ’24
APNS Connection Timed out
This error has been continuously occurring for about 9 hours. We have not replaced the certificate, modified the server code, or changed the firewall policy. Some requests succeed, but many are timing out, with several timeouts occurring every minute. We are unable to find the cause. Please help. APNS Exception io netty channel ConnecttimeException: Connection timed out
APNSOutboundHandler api.push.apple.com/17.188.169.28:443 api.push.apple.com/(other ip):443 api.push.apple.com/(other ip):443 api.push.apple.com/(other ip):443 api.push.apple.com/(other ip):443 ...
1
0
311
Sep ’24
api.sandbox.push.apple.com unavailable
Hi, since at least yesterday api.sandbox.push.apple.com is not available. It was working before, but now it seems the domain can't be resolved. I tried nslookup in the terminal. nslookup api.sandbox.push.apple.com ** server can't find api.sandbox.push.apple.com: NXDOMAIN Lookup of the production server works: nslookup api.push.apple.com Non-authoritative answer: api.push.apple.com canonical name = api-vs.push-apple.com.akadns.net. Name: api-vs.push-apple.com.akadns.net Address: 17.188.180.206 Name: api-vs.push-apple.com.akadns.net Address: 17.188.180.76 Name: api-vs.push-apple.com.akadns.net Address: 17.188.180.138 Name: api-vs.push-apple.com.akadns.net Address: 17.188.182.203 Name: api-vs.push-apple.com.akadns.net Address: 17.188.180.78 Anyone having the same problem?
1
0
264
Sep ’24
APNS Sandbox domain
A few days ago I started receiving errors from my server about it being unable to find the host api.sandbox.push.apple.com. About 10 minutes ago I tried to ping that domain and got an unknown host error. Just now I tried it again and it was able to find the host. Is there some intermittent issue with their DNS?
1
0
256
Sep ’24
Where to retrieve Live activity update token that was started with ActivityKit push notifications using push-to-start token?
I can successfully start a Live Activity using push-to-start token, but in order to update the Live Activity i need another token as stated in the docs: While the system starts the new Live Activity and wakes up your app, you receive the push token you use for updates. When the app is open, i can retrieve this update token and successfully update the Live Activity using this example code: func observeActivityPushToken() { Task { for await activityData in Activity<LiveActivityAttributes>.activityUpdates { Task { for await tokenData in activityData.pushTokenUpdates { let token = tokenData.map { String(format: "%02x", $0) }.joined() print("Push token: \(token)") } } } } } But when the app is closed, how/where do i manage to get this update token and send it to the server "when the system wakes up the app"?
2
1
295
Sep ’24
What is causing this BadDeviceToken response from APNs?
I am trying to migrate to the new APNs Provider API. Here is how I've been registering for push notifications: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {     //-- Set Notification     if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])     {         // iOS 8 Notifications: Registering for notifications and types         [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];         [application registerForRemoteNotifications];     }     else     {         // iOS < 8 Notifications         _storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];         [[UIApplication sharedApplication] registerForRemoteNotificationTypes:          (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];     }     _storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];     [[UIApplication sharedApplication] registerForRemoteNotificationTypes:      (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert)];     if (launchOptions != nil)     {         NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];         if (dictionary != nil)         {             NSLog(@"Launched from push notification: %@", dictionary);             /*[self addMessageFromRemoteNotification:dictionary updateUI:NO];*/         }     }      return YES; } Within the last week, I have been using the following terminal command from Sending Push Notifications Using Command-Line Tools to successfully send a test push notification to a testing device. curl -v --header 'apns-topic: com.domain.appname' --header apns-push-type: alert --cert aps.cer --cert-type DER --key PushChatKey.pem --key-type PEM --data '{"aps":{"alert":"Test"}}' --http2  https://api.sandbox.push.apple.com/3/device/258ecf658e25256c8f06ddb1138d5d536ba0e760a96ebd12d3b1dbe112857c58 Recently after creating provisioning profile and adding it to Xcode, the app no longer prints the device token in the debug window. After removing the provisioning profile from my Apple Developer account under profiles, I tried using a backed up version of the app which still prints a device token to the debugger window. When I copy the device token and enter it into the terminal command to send another test push notification, the terminal output is a 400 status code : {"reason":"BadDeviceToken"}* Closing connection 1 curl -v --header 'apns-topic: com.domain.appname' --header apns-push-type: alert --cert aps.cer --cert-type DER --key PushChatKey.pem --key-type PEM --data '{"aps":{"alert":"Hello From Faunna"}}' --http2  https://api.sandbox.push.apple.com/3/device/a146d82d4acea02c9ef6de5838174292d0e2cd18a40be17fb79334c5003a0058 * Could not resolve host: alert * Closing connection 0 curl: (6) Could not resolve host: alert *   Trying 17.188.138.73... * TCP_NODELAY set * Connected to api.sandbox.push.apple.com (17.188.138.73) port 443 (#1) * ALPN, offering h2 * ALPN, offering http/1.1 Enter PEM pass phrase: * successfully set certificate verify locations: *   CAfile: /etc/ssl/cert.pem   CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Request CERT (13): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Certificate (11): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS handshake, CERT verify (15): * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS change cipher, Change cipher spec (1): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 * ALPN, server accepted to use h2 * Server certificate: *  subject: CN=api.development.push.apple.com; OU=management:idms.group.533599; O=Apple Inc.; ST=California; C=US *  start date: Feb  8 21:41:22 2021 GMT *  expire date: Mar 10 21:41:22 2022 GMT *  subjectAltName: host "api.sandbox.push.apple.com" matched cert's "api.sandbox.push.apple.com" *  issuer: CN=Apple Public Server RSA CA 12 - G1; O=Apple Inc.; ST=California; C=US *  SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x7fbd4700aa00) > POST /3/device/a146d82d4acea02c9ef6de5838174292d0e2cd18a40be17fb79334c5003a0058 HTTP/2 > Host: api.sandbox.push.apple.com > User-Agent: curl/7.64.1 > Accept: */* > apns-topic: com.faunna.PushChat > Content-Length: 37 > Content-Type: application/x-www-form-urlencoded >  * Connection state changed (MAX_CONCURRENT_STREAMS == 1000)! * We are completely uploaded and fine < HTTP/2 400  < apns-id: 8DE6AA75-8E41-E95E-1FAF-51D93A8B3200 <  * Connection #1 to host api.sandbox.push.apple.com left intact {"reason":"BadDeviceToken"}* Closing connection 1 What is causing the bad device token output in this set up? And how should I be registering for remote notifications from this point forward?
5
1
21k
Sep ’21
APNS Push sent via custom server using Certificate-based authentication not arriving
I have been trying to implement APNS Push Notifications into the iOS App I'm currently developing, and I'm having issues with notifications sent via my custom server not being delivered. I have built and ran the App on my device (iPhone running iOS 17.6.1), requested permission for notifications from UNUserNotificationCenter, and saved the device token for testing purposes. As a sanity check for the device token and the App entitlements, I used the CloudKit tool for testing Push Notifications. The notifications I send aimed at the "DEVELOPMENT" Environment work properly and arrive on the device. To configure my custom server, I created the Sandbox Apple Push Notifications certificate in my Developer portal, installed it on my Mac, exported the certificate and key together into a .p12 file, and created the PEM file using this command: openssl pkcs12 -in Certificates.p12 -out sandbox.pem -nodes -clcerts When my server attempts to send a notification, it appears to connect to the server and send the payload, but the notification never arrives on the device. I don't get any errors when my server writes the notification's binary payload to the connection. For clarity, here is the code from my server that sends the "aps" payload to APNS (written in PHP): public function sendPushNotification($deviceToken, $title, $message) { $jsonPayload = $this->composePayload($title, $message); $msg = $this->buildBinaryNotification($jsonPayload, $deviceToken); $this->connectToApns(); $result = fwrite($this->mApnsConnectionHandle, $msg, strlen($msg)); if (!$result) { $this->writeToLog("Message not delivered?!"); } else { $this->writeToLog("Message successfully delivered!"); } $this->disconnectFromApns(); } And this is the code for constructing the JSON payload, and for converting that JSON into a binary string: private function composePayload($title, $message) { // Create the payload body $body['aps'] = array( 'alert' => array( 'title'=>$title, 'body'=>$message ) ); // Encode the payload as JSON $payload = json_encode($body); return $payload; } private function buildBinaryNotification($payload, $deviceToken) { if (strlen($payload) > 0 && strlen($deviceToken) > 0) { $msg = chr(0) . pack('n', strlen($deviceToken)) . pack('H*', $deviceToken) . chr(0) . pack('n', strlen($payload)) . $payload; } return $msg; } Any suggestions or advice would be appreciated.
1
0
320
Sep ’24
Critical Alerts and Notification Permissions
Back story: I'm developing an app that communicates with a personal medical device. We use critical alerts when we have hardware issues that could result in harm to the patient. The audio file is a 30 second file to make sure the patient is aware. If the app is open when they occur, we pop up a modal message in the app. When the user dismisses the notice, we call UNNotificationCenter::removeDeliveredNotifications(withIdentifiers:) to remove the critical alert and also to stop the audio file that is playing. This normally works fine. However we discovered that if the patient leaves critical alert enabled but disables notifications for our app, that we can still post the critical alert and it goes off. However when the user dismisses the message, the removeDeliveredNotifications call does not work. I did some debugging and if call getDeliveredNotifications with this permission combination, it return 0 (normally it would return 1). Does anyone know of another way to remove the critical alert in this situation? (or should I be submitting this as a bug?)
1
0
221
Sep ’24
VoIP Not Working Background
Hello, I have an app which I have enabled VoIP entitlement and implemented all the CallKit and PushKit registries and delegates. I can successfully get a VoIP token. I can successfully send VoIP push notifications (and receive them via the PushKit delegate function) and then report an incoming call via CallKit, but only while my app is in the foreground. I have checked the entitlement in XCode and the Info.plist directly, and they both (as expected) show voip as a background mode. The VoIP notification is being sent via AWS SNS and everything works while the app is in the foreground. I cannot understand why the app is not waking up while in the background. This is the VoIP notification sent via SNS: aps: { alert: "Intercom call", "content-available": 1 } SNS Message Attributes: 'AWS.SNS.MOBILE.APNS.TOPIC': { DataType: 'String', StringValue: `${bundleId}` }, 'AWS.SNS.MOBILE.APNS.PUSH_TYPE': { DataType: 'String', StringValue: 'voip' }, 'AWS.SNS.MOBILE.APNS_VOIP.TTL': { DataType: 'String', StringValue: '0' }, 'AWS.SNS.MOBILE.APNS_VOIP_SANDBOX.TTL': { DataType: 'String', StringValue: '0' }, 'AWS.SNS.MOBILE.APNS.PRIORITY': { DataType: 'String', StringValue: '10' } As I say, func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) async works correctly when in the foreground. I cannot see any reason why it would not work from the background. I am also receiving normal remote notifications correctly foreground and background.
2
0
389
Sep ’24
Understanding Time Sensitive Notifications for macOS?
I've seen a fair amount of resourcing for iOS notifications, but on macOS there is little if any documentation on what we're supposed to experience when using time-sensitive notifications. We are intending to send time-sensitive notifications about IDP credentials from our agent to the end user, with the intention of breaking through Do Not Disturb or Focus modes. What should we expect the experience to be? We've implemented the notifications, but on macOS, they do not break through focus or DND the way that we'd expect them to.
1
1
246
Sep ’24
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.6k
Dec ’23
PushKit: XPC PushKit connection invalidated from client
Hi, Some of my iOS test devices do not receive PushKit notification anymore. I request and receive a VoIP token at app startup, then register it. I report any incoming PushKit notification directly to CallKit on the same thread. But some devices do not receive the PushKit/VoIP notification (app in foregroud or in background). They used to. Some other devices are receiving it with the same code, for a successful call. I tried reinstall and device restart with no success. I can see on the problematic devices at app startup in the console: callservicesd XPC PushKit connection invalidated from client <private> before seing: callservicesd Registering client process <private> with bundle identifier <private> for PushKit voip in environment <private> I could not find anything on "PushKit connection invalidated from client", anyone knows what triggers it? Thanks.
2
0
727
Jan ’24
Critical Alert Sound Fades In Instead of Playing at Full Volume on iOS
I’m currently developing an iOS app that includes critical alerts as part of our notification system. We’ve noticed an issue where, on some occasions, the critical alert sound fades in rather than playing immediately at full volume. Behavior: When a critical alert is triggered, the notification sound sometimes fades in gradually, instead of starting at the desired volume level right away. This doesn’t happen every time, but it’s frequent enough to be concerning. Has anyone else encountered this issue, or does anyone have insights into why this might be happening? We’re looking for advice on how to ensure the sound plays correctly every time a critical alert is triggered.
2
0
292
Aug ’24
APNS key download issue
Has anyone had problems downloading a newly created APNS key? The first key I made downloaded fine. I realised I had made it on the wrong team, so I revoked it, changed team and made a new key. The first time I clicked Download, it said the key had already been downloaded. I suspected the problem was that I had named it the same as the one I had made in error, so I revoked that new key, and made a new one with a different name, but it still wouldn't download. Has anyone had this? Any workarounds? Thx.
6
1
1.9k
Apr ’24