Respond to push notifications related to your app’s complications, file providers, and VoIP services using PushKit.

PushKit Documentation

Posts under PushKit tag

44 Posts
Sort by:
Post not yet marked as solved
0 Replies
301 Views
The crash 0xbaadca11 seems to happen with PushKit and CallKit usage. I/we understand that as and when we receive voip push message from PushKit, we have to report the call to CallKit. However in some situations and data from payload (Like call with UUID already exists / payload decryption fails) where we are not supposed to report the call to user. The app gets crashed and further get blacklisted to get calls. Is there any way for developers to directly and silently report call failure to PushKit / CallKit.
Posted Last updated
.
Post not yet marked as solved
0 Replies
386 Views
Hello! Currently we are reviewing an issue whereby our users were obtaining Live Activities update, but somehow at the end, there were Live Activity updates that were not properly received by the device. For example: 20 Live Activity updates sent to device, 17 were properly received, however the last 3 were not properly received (as can be seen by the UI of it not updating). So far we have looked into a few root causes highlighted on the forums and on stackoverflow: Timestamp of APNS (every one of the APNS has a different timestamp) 200 is seen from the APNS side, which is why we were confused by the push notification did not arrive on the device side Looking into our logs, its unfortunately not covered enough to tell us when this had been received Some questions here: Is there a way we could log every Live Activity / Push Notification received from APNS? (for all scenario, app on lock screen, app in background) Anyway to track a push notification's lifecycle? I know the Push Notification Console tool is useful for debug usage, but we wanted to see if there's something similar for production usage as well.
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
I have an existing iOS application available on AppStore which has push notification implemetented. Currently we are using the legacy binary protocol in Server side while sending request to the Apple Push Notification service (APNs) which will no longer support post of November 2020.We are making changes to update this with enhanced HTTP/2 based API in server side to communicate with APNS, will this impact my existing iOS application? Do I need to make any changes / code changes from client (iOS App) side to make it compatible with my existing application?
Posted Last updated
.
Post not yet marked as solved
0 Replies
322 Views
From an MacOS Application, I want to listen for the arrival of push notification event for any app installed on the Mac system. I understand, AppKIt provides API to listen for receiving push notification of that application. But, Is there any API, which can listen and just notify the developing app when a notification arrived for any apps installed on the system?
Posted Last updated
.
Post not yet marked as solved
1 Replies
464 Views
I have created VOIP IOS app in Xamarin, I have registered pushkit in the AppDelegate's didFinishLaunchingWithOptions and have implmented PKPushRegistryDelegate's didReceiveIncomingPushWithPayload:forType:withCompletionHandler and immediately report to call kit and invoke the completion handler. However whenever I receive a VOIP push after device boot I get these console logs: default 15:24:32.153522-0400 callservicesd Invalidating process assertion for bundle ID <private> from timeout error 15:24:32.154786-0400 callservicesd Killing VoIP app <private> because it failed to post an incoming call in time. It kills my app BEFORE I have a chance to report it to call kit since it DOESN'T enter the didReceiveIncomingPushWithPayload:forType:withCompletionHandler. However if I wait 2+ minutes after device boot to send a VOIP APN Push I will receive the VOIP push, it will enter didReceiveIncomingPushWithPayload:forType:withCompletionHandler and report it to call kit just fine. I don't understand why this is the case and how to fix it. I have been told to make the app just like What's App so my app must be able to receive incoming voip push at any point the device is on. Is this an issue with the device? I have been testing on a iPhone 7 Plus on version 15.7.1. Is this a internet connection issue? Could it be something else? Is there an explanation for this behavior and is there any solutions? Thank you very much
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.5k Views
We are implementing PushKit/CallKit for audio video calls. When the app starts, it immediately in AppDelegate-didFinishLaunchingWithOptions create the PKPushRegistry, set the delegate and ask for the token with desiredPushTypes and upload the token to our backend when PKPushCredentials are received. Then when didReceiveIncomingPushWith is called, it directly reports the call to CallKit. That works fine on all devices, with the app in foreground, background, killed etc.. But on one slow device (iPhone 7, iOS 15.6.1) when the app has been killed for some time, the app do not receive anymore the token. Then at some point PushKit doesn't wake the app anymore, as CallKit was not notified. According to the console logs by filtering callservicesd, the time between receiving the PushKit notification being received and delivering the token changes a lot, and then can timeout: Successful call: default 15:00:58.181051+0200 callservicesd Received incoming APS message from application with bundle identifier <private> and topic <private> // ... default 15:01:00.627903+0200 callservicesd Delivering token <private> to application <private> So 2 seconds. Failing call: default 14:13:20.325371+0200 callservicesd Received incoming APS message from application with bundle identifier <private> and topic <private> // ... default 14:13:28.827702+0200 callservicesd Delivering token <private> to application <private> // ... default 14:13:32.325062+0200 callservicesd Invalidating process assertion for bundle ID <private> from timeout 8 seconds. Even if "callservicesd Delivering token" is written in the logs, the app do not receive it. Then for the failing call, as didUpdate pushCredentials and didReceiveIncomingPushWith are not called, the app get killed: default 14:13:32.326334+0200 runningboardd Invalidating assertion 33-134-19180 (target:[application<myAppId>:1363]) from originator [daemon<com.apple.telephonyutilities.callservicesd>:134] default 14:13:32.393456+0200 runningboardd Received termination request from [daemon<com.apple.telephonyutilities.callservicesd>:134] on <RBSProcessPredicate <RBSProcessIdentityPredicate| application<myAppId>>> with context <RBSTerminateContext| domain:10 code:0xBAADCA11 explanation:<no explanation given> reportType:CrashLog maxTerminationResistance:Interactive> error 14:13:32.404027+0200 callservicesd Killing VoIP app <private> because it failed to post an incoming call in time. Is there any way to make sure that the token and the VoIP push will be delivered in time and not be killed by iOS, even on slow device?
Posted
by md_td.
Last updated
.
Post not yet marked as solved
7 Replies
6.4k Views
I don't know what could be wrong but my UNNotificationServiceExtension is never getting called by any push from FCM. I call the FCM from a Python3 script and so far it works (I get a push notification but always with the default text and not the modified one). firebaseHeaders = { "Content-Type":"application/json", "Authorization":"key=MYKEY" } firebaseBody = { "to":devicetoken, "priority":"high", "mutable-content":True, "apns-priority":5, "notification": { "titlelockey":"push.goalReachedTitle", "bodylockey":"push.goalReachedContentRemote", "bodylocargs":[str(entry['value']), entry['region']], "sound":"default", "badge":1 }, "data": { "values":data, "region":entry['region'], "value":entry['value'] } } firebaseResult = requests.post("https://fcm.googleapis.com/fcm/send", data=None, json=firebaseBody, headers=firebaseHeaders) My Extension is also pretty basic (for testing) and I already tried to remove it and add it again to my main app project without success. class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) if let bestAttemptContent = bestAttemptContent { bestAttemptContent.title = bestAttemptContent.title + " [TEST 123]" contentHandler(bestAttemptContent) } } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { contentHandler(bestAttemptContent) } } } Anyone has a idea what I still can check, test or miss?
Posted Last updated
.
Post not yet marked as solved
0 Replies
525 Views
I'm developing a Flutter application that utilizes topic messaging to send notifications to iOS devices using Firebase Cloud Messaging (FCM). I've followed the FCM documentation to initialize the topic and set up an API for sending messages. The API is triggered every hour through a cron job on the server. When a topic message is received, the app displays a notification and performs some background processing. While the notification is successfully delivered when the app is in the background, I'm encountering inconsistent behavior when the app is in a killed state. What I've Tried: I've double-checked the implementation of the FCM topic initialization and the message sending API, and everything appears to be correct. I've also verified that the cron job on the server is running as intended and the API calls are being made regularly. The issue seems to be related to how the app behaves when it's not running in the background. Topic Initialisation: if (!Platform.isAndroid) { await FirebaseMessaging.instance.subscribeToTopic("ios-scheduling"); } API for delivering topic message: router.post('/', (req, res) => { const topic = "ios-scheduling"; const body = req.body; console.log("Request Body", req.body); const message = { notification: { title: "OsuniO", body: "You may have some pending tasks.", }, data: { "notificationType": body['notificationType'] }, apns: { payload: { aps: { contentAvailable: true, "interruption-level": "time-sensitive" } }, headers: { "apns-push-type": "background", "apns-priority": "5", "apns-topic": "io.flutter.plugins.firebase.messaging" } }, topic: topic }; console.log("message to be sent to the user: ", message); admin.messaging().send(message) .then((response) => { // Response is a message ID string. console.log('Successfully sent message:', response); res.status(200).json(message); }) .catch((error) => { console.log('Error sending message:', error); res.status(400).json({ message: error }).end(); }); }); module.exports = router; Expected Behavior: I expect that when a topic message is sent via FCM, regardless of whether the Flutter application is in the foreground, background, or killed state, the notification should be reliably displayed on the device. Additionally, the associated API should be triggered consistently to perform the required background processing.
Posted Last updated
.
Post not yet marked as solved
3 Replies
2k Views
Hello, we're currently working on an app for emergency organisations. In case of an emergency it's crucial to alert all users just in time. We've tested remote notifications. They're not really reliable for a time critical use case. Our idea is to use VoIP push notifications to alert the users. Before we start testing it, I would like to know if we'll run into an issue with the App Store approval if we just use VoIP PN without having VoIP functionality in our app. Regards, Enno
Posted
by ev_ma.
Last updated
.
Post marked as solved
1 Replies
739 Views
Hello guys I am getting this error Unrecognizable claims found when trying to validate my JWT Token for push notifications. I don't understand what it means. Can someone tell me how to resolve this issue? I am using python, and using the time module to generate the epoch. I guess, this is where the issue is coming from, but I am not sure. import time epoch = time.time() Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
0 Replies
589 Views
In my application, I'm using both APNS for push notifications. In my app, both tokens are generated properly and updated on my App's server. When sending an APNS push from my server, the push is successfully reached the APNS server, but can't deliver to the device, even though we are getting success from APNS Server. we are getting 200 from APNS. but the same thing If I am trying to use the "Push Hero" 3rd Party app, and I am getting notifications in the app also, with no any issue. but can't get it from my server. I am using a .p8 file for push notifications in both the server and 3rd party apps.
Posted
by Narijayu.
Last updated
.
Post not yet marked as solved
1 Replies
566 Views
I made an app for calls with CallKit and PushKit. It seems everything is done correctly, according to apples manual on CallKit and PushKit. If I start app on two devices, and try to make a call everything is working for the first time, and it can work for the second time and so on. But then, by unknown reason (I don't handle any errors), the phone that receives voip push notification ringing but doesn't show the panel with answer/decline buttons. If that happens, new incoming calls work the same broken way. To improve that broken situation I must initiate outgoing call with CallKit on broken phone. I don't post any code, it just the same as in numerous examples. Do anyone has guess what's wrong?
Posted Last updated
.
Post not yet marked as solved
0 Replies
463 Views
The name of my app is mixed in uppercase and lowercase, but when I tested the push, all the app names in the notification I received were changed to uppercase letters. For example, the APP name is AppTest, and the APP name displayed in the notification is APPTEST. Why is this
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
When I call the completion handler from the following User Notification Center delegate function and pass UNNotificationPresentationOptions.sound I still get the notification banner: override func userNotificationCenter( _ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void ) { completionHandler(.sound) } All I want is a way to just make a notification sound without showing the notification while the app is in the foreground. Any ideas? This is how I am requesting authorization: [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions: (UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler: ^ (BOOL granted, NSError * _Nullable error) { }]; This is the notification request: var notification = UNMutableNotificationContent() if (notification != nil) { notification.categoryIdentifier = "id" notification.sound = .default notification.title = "title" notification.body = "body" request = UNNotificationRequest( identifier: NSUUID().uuidString, content: notification, trigger: nil ) UNUserNotificationCenter.current().add(request) { (error) in }
Posted Last updated
.
Post not yet marked as solved
0 Replies
644 Views
Code file I am working in VOIP application. I can receive voip push when app in background or foreground. But when an app is killed and device locked voip delegate "didReceiveIncomingPushWithPayload" method not called. Also, I am facing below crash Killing VoIP app because it failed to post an incoming call in time VoIP push for app dropped on the floor
Posted
by leo_prem.
Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
According to SpeakerBox sample code, the Watch App should register for receiving the PushKit notifications like so: let pushRegistry = PKPushRegistry(queue: DispatchQueue.main) pushRegistry.delegate = self pushRegistry.desiredPushTypes = [.voIP] This would then cause a delegate method to be called with a token: func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) { } That, however, never happens. I've already have the required entitlement and this exact same logic works fine on the main iOS app, however, in the companion watchOS app, it does nothing. What am I missing here? Also, since this is not a standalone watchOS app, it doesn't really make sense that it would have its own pushKit token. Isn't there a way to notify the watch about an incoming call using the same pushKit token received on the phone? Thanks in advance,
Posted
by lkz32.
Last updated
.
Post not yet marked as solved
1 Replies
953 Views
We're currently trying to develop an Apple Watch companion app for our iOS app using the new WatchOS 9 which has the VoIP call capabilities. Is there a way to mirror VoIP notifications similarly to push notifications between the WatchOS app and iOS app? Essentially we'd like to be able to send a VoIP notification to the iOS app and have the answer/decline call screen show up in both the iPhone and Apple Watch. Currently when we send a VoIP notification to the iOS app, the Apple Watch does not receive anything. Push notifications and local notifications work just fine.
Posted
by JoL07.
Last updated
.