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
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
by
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
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
by
Post not yet marked as solved
4 Replies
1.9k Views
I took delivery of my first M1 Mac (iMac running Big Sur 11.4) and with great anticipation installed my iOS VoIP App from the AppStore. I was greatly disappointed to see that There were no VoIP Pushes to start an incoming call Callkit does not seem to work so I get no Audio. Am I missing something? Is there some permissions or configuration I might need to set? Or is it just that Callkit and Pushkit don't work even though it states on developer.apple.com that they are supported on macOS 10.15+ Any advice or guidance greatly appreciated. Very disappointed :-(
Posted
by
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
by
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
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
Post not yet marked as solved
1 Replies
954 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
Post not yet marked as solved
3 Replies
903 Views
I'm trying to test local push notification from Receiving Voice and Text Communications on a Local Network example, i already done all steps : installed the App Push Provider entitlement, create the two id app certificat imported them ... i have the local server launched i can see the following log 2023-05-02 00:31:49.141283+0200 SimplePushServer[51369:1371374] [Debug] Channel Control: Listening on port 5060 2023-05-02 00:31:49.163541+0200 SimplePushServer[51369:1371374] [Debug] Channel Notification: Listening on port 3000 SimplePushServer started. See Console for logs. i run the SimplePush on a device, i entered the wifi ssid and the simple push server adress with the good port but the active is always no on the screen config how can i test the local push notification ? can i send a text for example to the server and the application will get it ? thank you for your help
Posted
by
Post not yet marked as solved
0 Replies
647 Views
It is a kind of skype application. When the app goes background, after 15/20 mins when trying to call anyone of the user's extension using call functionality, I can hear the message "user is not available". I have used SIP.js and free switch for this call functionality and also i am using background timer for android and VOIP push notification for IOS. I want my app to work eventhough it was killed and also till logout. registerGlobals(); const userAgent = new UserAgent( this.getUserAgentOptions(extension, password) ); console.log("!!! SIP initiaing useragent.start"); userAgent.start().then(() => { console.log("!!! SIP inside useragent.start"); const registerer = new Registerer(userAgent, { expires: 120, refreshFrequency: 95, logConfiguration: true, }); registerer.register(); // backgroundsync BackgroundTimer.runBackgroundTimer(() => { console.log("$$$ background timer before$$$"); this.isBackgroundSyncStarted = true; // this.loadData(true); registerer.register(); // code that will be called every 3 seconds console.log("$$$ background timer after$$$"); }, 20 * 1000); if(Platform.OS == "ios"){ BackgroundTimer.start(); } console.log("!!! SIP registerer registered"); });
Posted
by
Post not yet marked as solved
1 Replies
448 Views
I have an App that is part of a VoIP PBX system but which is NOT a VoIP App. It acts like a remote control that allow you to forward calls to our VoIP PBX to your cellular phone, or even setup calls to internal extensions all by using the Cellular network. One of the features we want to implement is to indicate to other users on our VoIP PBX system that someone using our App is in an active call using the cellular network. We managed to make that work, but only whilst the App is in the foreground. We are now struggling to find proper ways to activate a little bit of code in our App that will relay the Phone App state (RINGING, OFFHOOK, INCALL, etc...) to our VoIP PBX system. We are not a VoIP application and as such cannot utilise CallKit, and from what I understand, we cannot use PushKit anymore without using CallKit because people were abusing it to keep running their App in the background and thus reducing battery life. (Which I fully comprehend). But our app does not need to be active in the background and isn't a VoIP App, we only need it to wake up when the Phone App state changes and then do it's small networking task. So, can this actually be done properly? PS: To ensure the privacy of the user, the user needs to enable this feature him/herself. It is not enabled by default and can be switched off by the user as well.
Posted
by
Post not yet marked as solved
0 Replies
440 Views
lately, we found out that all notifications from the app I developed suddenly vanished for no reason when a new notification arrived. Mostly this case happened on iOS 16, and the notification has threadID by which we want to fulfill the notification grouping. When I continuously sent 4-5 notifications to my iPhone this case will happen. Problem screen recording did anyone encounter this situation? Why and how to fix it
Posted
by
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
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
by
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
by
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
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
by