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

APNs Pushes Failing, Device is "offline" when it's not
Hi - I'm having issuses with pushing notifications both locally and from a server to either my phone or the simulator. KEEP IN MIND I had previously had them working not an hour ago, and for some reason, after changing no code i come back to errors upon errors. I am using 17.0.2 and xcode. Here are some things i've tried: CloudKit's Push notification console - one day it just suddenly stopped working, and doing pushes that previously had worked suddenly gave the vague and very unhelpful error message "device was offline." I know my credentials and device token are all valid because it doesn't throw any other errors regarding that. AWS Pinpoint/SNS - i previously had it working sending push notifications from SNS. I get a 200 response, but it still doesn't show a push notification. I think Apple is misinterpreting "discarded as device was offline" somehow as a success? .apns drag-n-drop - i literally sometimes fail dragging and dropping into the simulator a properly configured .apns file to trigger a notification. Sometimes it works, sometimes it doesn't. The literal only thing i changed was adding the target of the user notifications extension (so i can add custom actions on a notification). Unless that target somehow broke everything, Apple seems to think my device is offline. Hopefully someone might have been experiencing this and can understand my fury.
2
0
2.2k
Jan ’24
Notification Service Extension usage time
Hello all. I noticed, that NSE living more than 30 seconds ( that described in doc ). When app receive notification, it created process NSE, and send notification to didReceive function, after this, app have 30 seconds to call contentHandler closure, after contentHandler is called, I expected that NSE process is killed, but it's not. If app using singletons in NSE, they won't dealloc after contentHandler is called, so, after new notification received, singletons still alive. Does it legal to not drop connection to websocket after contentHandler closure get called? For example, notification received, NSE process is loaded, websocket manager signleton is initialzied and started session, after few seconds contentHandler closure get called, so, system won't kill NSE because of 30 seconds timer, and my web socket connection will alive so long as possible, so, I not need to open it each 30 seconds, is that legal or not?)
3
0
750
Jan ’24
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
706
Jan ’24
APNS Key Vs Certificate Security
I've learned that providing an APNS “Key (Cannot expire)” instead of an APNS “Certificate (Can expire)” will provide the app "access to all topics" for all apps within the organization ‘team’ that the key is forged from. 1.) Can someone elaborate on the specifics for what that means from a security prospective? For instance, if my organization 'team' manages many applications under the same umbrella account and provides the same (or different) APNS key to each app, but one of the apps accidentally (or intentionally) wants to utilize the APNS key to affect the other apps, what are the potential consequences? And, is it possible to create a new APNS key for each app to close any security concerns for multiple apps managed under the same account, or are we stuck with every key having access to all topics?
1
1
1.8k
Jan ’24
Push to Talk framework failing state after restart
Our PTT framework app works great but we have now found an interesting scenario where you can get the PTT Framework in a state that is non functional. Here's how it can be reproduced: Start your PTT app ( With PTT framework ) Successfully joined channel and we can transmit and receive incoming transmits. Put app in background. ( PTT framework/GUI symbol present in top) Wait 1 min Restart phone by pressing volume up + right side button Wait 1 min Start phone We can now get two scenarios: "Sceanario *1": In 4 of 5 cases the PTT framework symbol will be present directly when phone is started. If we here start running our app we can see that the channel is restored and everyting works perfectly. "Sceanario *2": In 1 of 5 cases the PTT framework symbol is not present after phone is started, and will not be even if waiting. If we here start running our app we can see that the channel is also here restored (channelDescriptor(restoredChannelUUID channelUUID: UUID) -> PTChannelDescriptor) and we can successfully call "mgr.setTransmissionMode(newTransmissionMode, channelUUID: self.channelUUID)" on our channel ( PTT framework symbol still not present !!!!) If we now try to call "requestBeginTransmitting(channelUUID: UUID)" we will get the PTChannelError error channelNotFound !!!! We are then reacting to this and trying to do leave the channel "leaveChannel(channelUUID: UUID)" but also this is returning PTChannelError error channelNotFound in "channelManager(_ channelManager: PTChannelManager, failedToLeaveChannel channelUUID: UUID, error: Error))" !!!! The interesting thing here is that my log is saying the following: PTTFrameworkImpl: failedToLeaveChannel 6D5AFE96-9389-4CFB-893A-64D51D4542XX error=The operation couldn’t be completed. (com.apple.pushtotalk.channel error 1.), joined=true, activeChannelUUID is=6D5AFE96-9389-4CFB-893A-64D51D4542XX. So we are getting channelNotFound for 6D5AFE96-9389-4CFB-893A-64D51D4542XX but when at the same type checking active channel with channelManager.activeChannelUUID we are getting 6D5AFE96-9389-4CFB-893A-64D51D4542XX. After this we logout our user in our app. If we now try to login again we will get a scenario where "requestJoinChannel(channelUUID: UUID, descriptor: PTChannelDescriptor)" will result in just NO RESPONS in means of "channelManager(_ channelManager: PTChannelManager, didJoinChannel channelUUID: UUID, reason: PTChannelJoinReason)" or "channelManager(_ channelManager: PTChannelManager, failedToJoinChannel channelUUID: UUID, error: Error)" FYI: The fault are occuring on 17.3 also and the syslog I provided here is on 17.3 developer beta One interesting observation we have seen is that we only see this problem when "allow location access" is set to never for our app.
6
1
816
Jan ’24
High "Discarded - Disabled" metrics for Location Notifications
Hi everyone, I've run into an issue with push notifications in our app, specifically those related to the location push service extension. In the Push Notifications Console, there's a high number of notifications marked as “Discarded - Disabled” under Location Notifications. I'm trying to figure out what's causing this. We are seeing thousands of “Discarded - Disabled” for location but the other push types are being discarded in much smaller numbers (in the tens). Here's what I need help with: What do the different 'Discarded' categories mean in push notifications? Which are normal and which are red flags? Why are so many Location Notifications being discarded as 'Disabled'? Is this a common device setting issue? Any tips on reducing these discarded notifications, especially for location-based services? Would really appreciate your insights or any pointers towards relevant resources! Thanks! LC
0
0
353
Jan ’24
App Transfer's effect on Push Notifications
I'm in the process of preparing to receive an iOS App transferred from a 3rd party developer. It's unclear from the transfer documentation whether Push Notifications will continue to work after the transfer is complete. Could anyone provide clarity on when push notifications would begin to fail, if at all? For instance, immediately at transfer, after the first release from the new app store, or no failure until new APN tokens are created? https://developer.apple.com/help/app-store-connect/transfer-an-app/overview-of-app-transfer/
1
0
713
Jan ’24
Periodic Background Update (including force-quit)
As the title says. We have a pretty specific need for our app, and I have an idea of how to achieve it, but would like input on whether it's good practice or not. In communication apps such as Whatsapp or Discord, they need to send local notifications (and ideally update cached message data so it's fresh) anytime the user gets a new message. Conveniently for them, they control the backend, and so can just send out a silent push notification to the device(s) of user involved. In our case, we are creating a UI for someone else's backend, meaning we can't simply send a silent push on data change. What we were originally thinking was a sort of crowd-source involving a combination of silent push and background refresh, but refresh won't work if the user closes the app. I've read all the given reasons for this, and though I still disagree, there isn't anything we can do about it. So what I'm now thinking is that, at whatever interval (say 1-3hrs) some serverless function sends a silent push to every single client, which will wake them up to make a fetch and compare to the cached data and send a local notification if necessary. Downside here is it will likely incur some cost, and frankly it just feels kind of iffy as a solution, but I'm not sure what else we can do without controlling the backend API. Thoughts? Is there anything I'm missing? Any better ideas? Thanks in advance!
2
0
532
Jan ’24
SIP Client app - Push notification unavailable
Hello Team, We have developed an SIP Client application, where the connection is through SIP Server. We are unable to handle incoming calls when app is in the background. The local servers are blocked by firewall due to which the push notification is unavailable and is only available via VPN connection. Requesting you to please guide us on how we can receive incoming calls without push notification. We also would like to know how we can receive incoming calls when the app is completely terminated or closed from background and how to auto-start the app to receive incoming calls.
2
0
575
Jan ’24
Persistent Issue with Push Notifications on iPhone Devices
I understand that you are facing an issue with push notifications not being delivered to iPhone devices in your app since January 12, 2024, at 4:05 AM (Japan time). You've confirmed that the APNS authentication key is still valid, and the key itself is correct. Additionally, you mentioned that push notifications are working fine on the sending device. Despite resetting the authentication key, the problem persists, and you haven't received a specific error code; instead, you are getting a general error message. To troubleshoot and resolve this issue, you may want to consider the following steps: Check for Apple Server Status: Ensure that Apple's push notification servers are operational. Sometimes, server outages on Apple's end can affect push notification delivery. Review Apple Developer Console: Double-check the Apple Developer Console for any relevant messages or issues related to your app and push notifications. It might provide additional insights into the problem. Check Device Settings: Confirm that the affected iPhone devices have proper network connectivity and are not in a "Do Not Disturb" mode. Also, ensure that the app's notification settings on the user's device are configured correctly. Review Payload and Certificate: Examine the payload of your push notifications and ensure that it complies with Apple's guidelines. Additionally, verify that your app's push notification certificate is still valid. Update to the Latest SDK: Make sure that you are using the latest version of the SDK provided by Apple for handling push notifications. Contact Apple Developer Support: If the issue persists, consider reaching out to Apple Developer Support for further assistance. They may be able to provide specific insights into the problem and guide you through the resolution process. Implement Logging: Introduce logging mechanisms in your app to capture more detailed information about the push notification process. This can help you pinpoint the exact stage where the issue occurs. Network Firewall and Proxy: Check if there are any network firewalls or proxies that might be blocking the communication between your server and Apple's push notification servers. Remember to document any additional information or error messages you receive during the troubleshooting process, as these details will be helpful when seeking assistance from Apple or other developer communities. If the problem persists, seeking professional assistance or consulting with Apple's technical support may be necessary. 【Message content】 Auth error from APNS or web push Service
0
0
840
Jan ’24
Handle background notification in terminated status app
i have an issue when handling silent push in my app when the user close the app, here is my native code which works like charm when the app in the foreground, background or terminated status from a short time from closing the app, and after long time from closing it (+30min) it will not work anymore, it make me confuse why it does not work and other messaging app like viber, whatsapp and messanger you can still receive messages and calls even you swipe the app and close it !! is there any thing must i add !! override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -&gt; Void) { Messaging.messaging().appDidReceiveMessage(userInfo) if Auth.auth().canHandleNotification(userInfo) { completionHandler(.noData) return } // sample notification for testing let content = UNMutableNotificationContent() content.title = "Hi there" content.body = "Just test" content.sound = UNNotificationSound.default let request = UNNotificationRequest(identifier: "helloNotification", content: content, trigger: nil) UNUserNotificationCenter.current().add(request) { (error) in if let error = error { print("Error adding notification request: \(error.localizedDescription)") } } // resent to dart side let controller: FlutterViewController = window?.rootViewController as! FlutterViewController let notificationChannel = FlutterMethodChannel(name: "notificationHandler", binaryMessenger: controller.binaryMessenger) var dataToSend: [String: Any] = [:] if let text = userInfo["text"] as? String { dataToSend["text"] = text } // Convert the dictionary to NSDictionary let nsDataToSend = NSDictionary(dictionary: dataToSend) // Pass the NSDictionary to Dart notificationChannel.invokeMethod("handleRemoteMessage", arguments: nsDataToSend) } i checked : background capabilities : remote notifs, background fetching, voip, background processing
1
0
1.6k
Jan ’24
Need Assistance: Unintended 'webServiceURL' Callback Triggered for All Apple Passes
I have successfully created an Apple Pass wallet with a 'webServiceURL' using PHP. The pass is added to the Apple Wallet successfully. However, when I sent a push notification to update a specific pass using its serial number, it worked as expected initially. However, in the last few days, Apple has been triggering the 'webServiceURL' callback for all passes, when we trigger a push for one pass/deviceID. I'm unsure how to prevent this callback from Apple. Please provide assistance on resolving this issue.
0
0
429
Jan ’24
LiveActivity crashs in iOS 14
LiveActivity is effective in ios16, but error reported only in ios14 Some error message reported from Xcode: Process: LiveExtension [20099] Path: my.app/PlugIns/LiveExtension.appex/LiveExtension libswiftCore.dylib swift_getAssociatedTypeWitness SwiftUI BodyAccessor.makeBody(container:inputs:fields:) SwiftUl closure #1 in WidgetGraph.init(rootBundle:)
0
0
388
Jan ’24
Push Notifications are not delivered to a good percentage of users
Hi all, In the app I developed for iOS I am using Firebase SDK (cloud messaging FCM) to provide the topic feature to deliver notification to thousands subscribed iOS users. I know FCM does not directly deliver the notifications to the final users and this is just an intermediary that formats the notification in way the APNs can understand client by client (using the APN device tokens) and this service (APNs) is in charge of delivering the notifications to the final users. The notifications are sent from a linux server through a cURL request to FCM. One example of silent notification that is like a heartbeat is below: !/bin/sh notifID=`date +"%Y%j"` value=`date -u "+%s.%N"` curl -H "Content-type: application/json" \ -H "Authorization:key=XXXXXXSECRETXXXXXX" \ -X POST -d '{ "to": "/topics/ioschannel","content_available":true,"data":{"notificationType":"silentNotification","silentNotificationId":"'$notifID'","senttime":'$value'},"priority":"high","headers":{"apns-priority":"10"},"time_to_live":60}' \ https://fcm.googleapis.com/fcm/send In the below image you can see some statistics provided by the metrics in the Apple Push Notification Console. We currently have almost 5.5k users who have mainly installed the app on their iPhones. As you can notice the APNs received a bit more than 5k notifications but what it is remarkable is the fact that only about 70% of the users receive the notification on their devices. Few notifications are on the APNs storage and delivered later on. Some devices can be offline and others are can be on power save mode but I don't understand why so many users are not receiving the notification (this particular notification is sent at 5 pm local time). Aside from the example silent notification I send other notifications to be processed in the background in the app in order to evaluate and decide to present or not a notification on the notification bar with a sound. The situation is the same, almost the same percentage don't receive the notification and almost 70% receive them on time. I have another app in Android and I don't have this problem. More than 90% of the users receive the notifications. What it is really interesting about Android is that the user can provide the permission to remove the app from the battery optimization. This is really important permission because the Android OS provides resources (network and giving priority to received push notifications) and even in power save mode the notifications are delivered. If I go straight from our linux server to APNs this situation won't change because APNs cannot deliver the notifications. Why is this happening? Is there any way to provide a permission to the app to have the highest priority? Any advice, feedback or hint will be really appreciated.
0
1
458
Jan ’24