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

PushKit Documentation

Posts under PushKit tag

64 Posts
Sort by:
Post not yet marked as solved
0 Replies
200 Views
Hello, I wanted to know if other people had a problem with their VOIP application especially with their incoming call since Thursday,April, 7. Or if you are aware of any changes. Because before April 7, all our versions already in production and also on TestFlight, allowed us to send or refuse incoming calls. And since then, it's no longer possible to do that on the versions only downloaded on the AppStore and TestFlight. But on the other hand everything works perfectly when I debug on xCode. Of course I tested on different phone versions (7,8,Xs,11) and on different OS (13,14,15) Thanks in advance,
Posted
by kertel.
Last updated
.
Post not yet marked as solved
0 Replies
196 Views
Recently, when replacing the push certificate, I accidentally put the revoked certificate online. Now it has been replaced with a valid certificate, but an error is still reported. Error reported by the server: ……routines:OPENSSL_internal:SSLV3_ALERT_CERTIFICATE_REVOKED
Posted
by CyanWang.
Last updated
.
Post not yet marked as solved
0 Replies
187 Views
I am learning about swiftui. I want my app to be able to send and receive a small amount of data to another app on another device. That device will include andriod as well as Apple. Since I am new to SwiftUI and iphone app development, I am not sure what to use to accomplish this. I thought that notifications would work well because the client app doesn't need to be in a run state or even in the foreground. However I decided I want to work with cross-platforms. I looked into Firebase but still have a lot of research to do. What can I use to send and receive data in a cross-platforms?
Posted
by schaubhut.
Last updated
.
Post not yet marked as solved
0 Replies
272 Views
XCode Version: 13.2.1 iOS Version: 15.3.1 I have an apple server setup for sending push notifications, that sends to both Production and Development environments. It is using certificate-based push, the type of certificate selected is this: Other than that the code is successfully registering for remote notification returning a unique device token. Here is the code for registering for notification. let center = UNUserNotificationCenter.current()       center.delegate = self as UNUserNotificationCenterDelegate       center.requestAuthorization(options: [.alert, .badge, .sound]) { granted, error in         print("Granted \(granted)")         print("Granted \(granted.description)")         if error != nil {           print("Error in permission for notificaiton")         }         if(granted){           print("Permission is granted")           DispatchQueue.main.async {             let settings = UIUserNotificationSettings(types: [], categories: .none)             UIApplication.shared.registerUserNotificationSettings(settings)             UIApplication.shared.registerForRemoteNotifications()           }         } else {           self.deviceToken = "PermissionDenied"         }       } Here is the registration callback override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken tokenData: Data) {     print("This is unnotification token \(tokenData.hexString)")     deviceToken = tokenData.hexString   } override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler  completionHandler: @escaping (_ options:  UNNotificationPresentationOptions) -> Void) {     print("Handle push from foreground")     // custom code to handle push while app is in the foreground     print("\(notification.request.content.userInfo)")     completionHandler(.alert)   }       override func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {     print("Handle push from background or closed")     // if you set a member variable in didReceiveRemoteNotification, you will know if this is from closed or background     print("\(response.notification.request.content.userInfo)")     completionHandler()   }       override func application(_ application: UIApplication,                didReceiveRemoteNotification userInfo: [AnyHashable : Any],                fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {          print("This is push notification data \(userInfo)")     // Inform the system after the background operation is completed.     completionHandler(.newData)   } Here is the server response for sending the notification to the device token provided to it. None of the callback is receiving the notification payload. Here is the notification payload: { "aps" : { "alert" : { "title" : "Game Request", "body" : "Bob wants to play poker", }, }, }
Posted Last updated
.
Post not yet marked as solved
0 Replies
179 Views
I'm seeing an issue with video calls where the green video dot reappears when the app is launched. But only if the device was locked when a voip call was answered. In my reportNewIncomingCallWithUUID I initially set .hasVideo to false, then a short time after I use reportCallWithUUID to update the call so .hasVideo is true. When the call ends I use CXEndCallAction which completes without any issues. This works fine when the device is unlocked. I get my VoIP push via pushkit, callkit shows an incoming call, my video call is running and everything appears to be closed down as expected. Relaunching the app does not show any green video dot. However when my device is iniitaly locked I get a different behavior. The code path is identical but after a video call the green dot reappears when the app is launched. When the app is not running there's no green dot on screen nor in the control center. But the green dot appears when I launch my app manually. I sure that I don't start the camera. What could I be missing?
Posted Last updated
.
Post not yet marked as solved
0 Replies
181 Views
Is my UNNotificationServiceExtension subclass instantiated per each call of didReceive(_ request: UNNotificationRequest ... or can one instance handle multiple calls of didReceive(_ request: UNNotificationRequest ...?I couldn't find any specific information regarding this behavior in the official documentation.
Posted Last updated
.
Post not yet marked as solved
1 Replies
264 Views
Hi, We are a new startup LetrWing from Delhi, India. We are building a new end to end encrypted workplace. For our app to function properly we will need to silently send notification in background to decrypt the content on client side and then show users the notification with decrypted content. As per the documentation we noticed that content-available = true wont be sufficient as this can delay the delivery of notifications (specially for our chat / time critical notifications ). We are using pushkit for our meeting and calls but we were wondering if there is a way to either use pushkit for time critical notifications or if there is any other means we can get silent notifications reliably on time and show our users meaningful messages ? We came across several post where the use of com.apple.developer.pushkit.unrestricted-voip-regulatory entitlement was proposed will it be possible to share how can we apply for using this entitlement in our app ? Thanks a lot in advance
Posted Last updated
.
Post not yet marked as solved
0 Replies
261 Views
Following document, https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html has a desription, "If the device token changes while your app is running, the app object calls the application:didRegisterForRemoteNotificationsWithDeviceToken: delegate method again to notify you of the change.", and you can read it so that the device token may be updated while the application is running. However, since this article is from 2018, I think it may not happen on newer versions of iOS. We would appreciate it if you could teach us the specifications for updating the device token. Best regards,
Posted Last updated
.
Post not yet marked as solved
0 Replies
274 Views
I'm developing a calling app used CallKit and PushKit. I'm thinking of creating an XC Test to ensure the quality of my app. However, I don't know how to write an XCTest for an app that uses CallKit. Could you help me if I know anything? I especially want to know about: ・I want to detect the event when tapped Accept on the CallKit screen that is displayed when an incoming call arrives. ・Similarly, I want to detect the event when tapped Decline.
Posted
by sango_m.
Last updated
.
Post not yet marked as solved
0 Replies
322 Views
I have created my custom alert for logging out of the application but the navigation push is not working. I have also cleared the stack and assigned a new view controller to sign in Here is my code       try firebaseAuth.signOut()        self.dismiss(animated: true, completion: nil)        let domain = Bundle.main.bundleIdentifier!        UserDefaults.standard.removePersistentDomain(forName: domain)        UserDefaults.standard.synchronize()        print(Array(UserDefaults.standard.dictionaryRepresentation().keys).count)                 let controller = storyboard?.instantiateViewController(withIdentifier: "SignInViewController") as! SignInViewController        navigationController?.pushViewController(controller, animated: true)        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {          self.navigationController?.popToRootViewController(animated: true)        }                          let signInVC = UINavigationController(rootViewController: controller)        let appDelegate = UIApplication.shared.delegate as! AppDelegate        appDelegate.window?.rootViewController = signInVC                        } catch let signOutError as NSError {        self.dismiss(animated: true, completion: nil)       print("Error signing out: %@", signOutError)      }
Posted Last updated
.
Post not yet marked as solved
1 Replies
291 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 marked as solved
2 Replies
383 Views
Hi folks, I am developing the app which is about to receive voip push to initiate video call in wkwebkit (the call itself is being processed on the webpage and php backend, using agora engine). My issue is: app was working perfectly with sandbox, however, when moved to production build with adhoc profile, for testing purposes, I found VoIP pushes are working OK in foreground VoIP pushes are not working at all if app is in background or not started. When I checked device logs (the one I am calling to), I can't see no app activity in it, as soon as the callee app is not in foreground mode. If it is in foreground, again, all is fine and works as a charm. All the integration is properly done with CallKit: I am reporting each and every push I receive as an incoming call with the variety of statuses, no push is unhandled / unreported. Just in case, I was trying to reinstall the app multiple times, but still the issue is here. I thought it can be the distribution certificate, voip certificate, keys or provisioning profile issue - but the fact it works fine in foreground makes me quite confused. I am testing it with 2 devices, one is iPhone 12 (iOS 15.2) with SIM in it, other one is iPhone 8 (iOS 14.7) with no SIM installed. Build is performed with XCode 13.1, on M1 Mac. Not sure it is important - just trying to share as much info as I can. Any advice is highly appreciated, because I am lost a bit and have no idea of what's wrong, or what needs to be checked/where to dig at first?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1k Views
My use case : i want the app to completely silence a given received alert push notification, based on information the app has locally (completely remove it, and never even display it. Not just change the sound or badge). So far i found no way of doing that : notification service extension doesn't let you remove the notification entirely, just change its content. Using "background / content" notification type then creating the notification locally doesn't work, since "background" notification type is unreliable by design. voip notifications are banned from being used as a general-purpose background notification mechanism since iOS13 Help would be greatly appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
660 Views
Hey, I would like to ask when we should call completion handler for didReceiveIncomingPushWithPayload delegate method if we have some async code fired inside. Let's have following examples: (completion called already in same runloop cycle) private let provider: CXProvider func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { /// code to get call info provider.reportNewIncomingCall(with: uuid, update: update) { error in /// some code here } completion() } (completion called at "future" when we "finish" handling voip notification, potentially future runloop cycle) private let provider: CXProvider func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { /// code to get call info provider.reportNewIncomingCall(with: uuid, update: update) { error in /// some code here completion() } } (error cases in both examples were omitted but i'm aware I should handle them too) Which one is more correct?
Posted
by macshur.
Last updated
.
Post not yet marked as solved
0 Replies
708 Views
VCS-2022-01-04-135942.log My app works fine on almost case, However once I update my Xcode to Xcode 13.2, and run app on iOS 15.2 it will crash on some reason, Here is crash signature: [Here is crash signature](https://developer.apple.com/forums/content/attachment/fbc2dbd8-0477-4842-a878-945419a71a25)
Posted
by Jeff Lu.
Last updated
.
Post marked as solved
1 Replies
313 Views
After I receive an apns request. func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) will be called. And I start fetch new items from my server. If new items have been deleted something that old items which already showed to the user contains. These have been deleted items will not disappear on the screen. func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {         task = Task {             do {                 let flat = MediaItemReference.flat(enumeratedItemIdentifier == .rootContainer ? root : enumeratedItemIdentifier.rawValue)                 guard let uuid = UUID(uuidString: flat.identifier) else {                     observer.finishEnumeratingWithError(FileProviderError.other)                     return                 }                 let fileContents = try await WebApi.getSubForFileProvider(uuid)                 let refs = fileContents.map { fileContent -> MediaItemReference in                     InfoPool.shared.set(fileContent.uuid.uuidString, value: fileContent)                     return MediaItemReference(                         identifier: fileContent.uuid.uuidString,                         isDirectory: fileContent.isDictionary,                         filename: fileContent.name,                         father: uuid.uuidString)                 }                 let items = refs.map(FileProviderItem.init(reference:))                 observer.didEnumerate(items)                 observer.finishEnumerating(upTo: nil)             } catch {                 print("=>", error.localizedDescription)                 observer.finishEnumeratingWithError(error)             }         }     }
Posted
by ZhuHaoyu.
Last updated
.
Post not yet marked as solved
1 Replies
222 Views
Hi, I am using CallKit/PushKit to integrate video calling with Twilio Video on my app. I am wondering whether there is some way to know from the outgoing side (the caller), when the receiver has either answered or declined the call - using CallKit/PushKit? Currently I start the connection with Twilio on the CXStartCallAction delegate method for the outgoing side and the CXAnswerCallAction delegate method for the incoming side. This works, but it would be preferable if the two could connect to the room at the same time. Is there a recommended way within the CallKit/PushKit framework to know when the receiver has accepted/declined the call? Thanks!
Posted Last updated
.
Post not yet marked as solved
0 Replies
283 Views
I previously create .pem file for voip push notification and it works without any issue. But when I try to create another .pem file same way as before it created the .pem file but throws ssl error I create the .pem file with this command openssl pkcs12 -in voip_services.p12 -out voip_services.pem -nodes -clcerts Error:OpenSSL SSL_read: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca, errno 0
Posted Last updated
.
Post not yet marked as solved
1 Replies
233 Views
When I updated to Xcode 13.2.1 ios 15.2 I found my pushKit not working anymore. After testing, it is found that everything is normal in the debug state, the installation package made with Ad hoc does not work properly, I cannot get the token, and there is no response when I use the previous token to push. I tried to write a simple test code in AppDelegate, it works fine in ad hoc state, and the logic implemented is not significantly different from what I used before. So is there anything in the latest update that could cause this kind of problem?
Posted
by Lihe2096.
Last updated
.