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
2 Replies
53 Views
I wanted to integrate location push extension to my app I followed the documentations and applied for the entitlement. I followed these steps: I added com.apple.developer.location.push to my app entitlement as follows <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict>     <key>aps-environment</key>     <string>production</string>     <key>com.apple.developer.location.push</key>     <true/> </dict> </plist> I got the location push token and formatted it to string locationManager.startMonitoringLocationPushes(completion: { data, error in if let error = error { print(error) return } guard let data = data else { return } let token = data.reduce("", {$0 + String(format: "%02X", $1)}) print(token) }) I exported the APNS push certificate after enabling additional capabilities from the app store connect and keychain. then converted to pem format openssl x509 -in aps_development.cer -inform der -out PushCert.pem openssl pkcs12 -nocerts -out PushChatKey.pem -in PushChatKey.p12 Tried to send push using command line TOPIC="com.myapp.location-query" CERTIFICATE_FILE_NAME="./test.p12:1234" CERTIFICATE_KEY_FILE_NAME="./new2k.pem" APNS_HOST_NAME="api.sandbox.push.apple.com" DEVICE_TOKEN="FE979AB7DAC975DD19E2F977EDB9BCD13C870AFD97D8D20955039666AA5DXXXX" curl -v \ -d '{}' \ --header "apns-topic: $TOPIC" \ --header "apns-push-type: location" \ --http2 \ --cert $CERTIFICATE_FILE_NAME \ --cert-type P12 \ --http2 https://$APNS_HOST_NAME/3/device/$DEVICE_TOKEN and the response is * Trying 17.188.138.70:443... * Connected to api.sandbox.push.apple.com (17.188.138.70) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * 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: Dec 10 00:29:46 2021 GMT * expire date: Jan 9 00:29:45 2023 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 0x11c80ce00) > POST /3/device/FE979AB7DAC975DD19E2F977EDB9BCD13C870AFD97D8D20955039666AA5DXXXX HTTP/2 > Host: api.sandbox.push.apple.com > user-agent: curl/7.77.0 > accept: */* > apns-topic: com.myapp.location-query > apns-push-type: location > content-length: 2 > 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: CA7EC88D-E839-318B-D9DC-DCB533F50808 < * Connection #0 to host api.sandbox.push.apple.com left intact {"reason":"TopicDisallowed"}% But I always get TopicDisallowed response Did I miss something?
Posted
by
Post not yet marked as solved
0 Replies
39 Views
So i’ve been testing voip calls of my app. One weird issue i noticed is that after few calls iphone stops receiving voip notifications. actually not just voip notifications but notifications from every other apps. i have two wifi networks at my home. when i switch from one network to other then suddenly voip notifications starts working and if there were any pending notification from other apps then those arrives too as soon as i change the network. Again i test calls few times and it works. then again same issue. if voip notifications doesn’t works then i just switch the network and notifications works. wondering if its iphone issue or ios or the router configuration thats delaying or preventing the notification from coming in.
Posted
by
Post not yet marked as solved
0 Replies
33 Views
i have an app with video call integrated and call kit integrated totally fine. when i cold launch the app launch time is absolutely normal. Now if my app is terminated and i recieve voip notification and see call kit banner and i accept the call from there, it launches my app. But it freezes like for 5 to 10 secs on a white screen. it happens everytime when i receive call and pick it up while app is in terminated state. i also loose the audio in these scenario. Need help to figure out if app launching from call kit answer call action and from normal tap on icon is any different?
Posted
by
Post not yet marked as solved
2 Replies
77 Views
Hallo there, We are using PUSHKIT and CALLKIT for waking up and showing the calls. But I ask for something like a voip background mode here, because a lot of features of our telephone system requiring an instant answer on SIP level. Sometimes with delay for example, so its not possible to use PUSHKIT here. So my question is: "How can we run a VOIP App in background, so that we can receive and show an incoming call WITHOUT push notifications?"
Posted
by
Post not yet marked as solved
0 Replies
84 Views
In my VoIP app that uses CallKit, while I'm in a connected call and report to the CXProvider a new incoming one only the CallKit UI is displayed (the screen with End&Accept, Decline and Hold&Accept). There's no sound indication whatsoever of the newly reported call. Shouldn't there be a knock sound on top of the current call's audio? Am I missing some required configuration for that? Thanks in advance.
Posted
by
Post not yet marked as solved
0 Replies
137 Views
Apple recently introduced and presented Web Push, a new Web Kit tool permitting to send notifications to users on your websites and web apps. However, push notifications have been a thing on macOS since Mavericks. Therefore, what is the difference between these two things ?(https://developer.apple.com/notifications/safari-push-notifications/ ) and that new thing (https://developer.apple.com/videos/play/wwdc2022/10098/)
Posted
by
Post not yet marked as solved
2 Replies
140 Views
Hello Everyone, I hope someone can help. We are using PushKit and CallKit as part of a VoIP calling application. This code has been working for several months. We noticed that as of some time PM Friday 10th, we no longer receive a token when debugging code to a locally connected iPhone in Xcode. Tokens are being generated in live environments and existing users are not affected. If we archive our debug builds to TestFlight the code runs correctly. To clarify: In debug if we request the cached token using .pushToken(for: voIP) nil is returned. In debug if we regster, the didUpdate delegate method is never called. If we publish this same code to TestFlight, didUpdate is called on app start and a call to retrieve the cached token is successful. The delegate and the pushregistry variable are not becoming nil as far as we can see and considering the code is working in TestFlight, how to you diagnose what is wrong? Code has been tested across a wide range of iPhone devices and releases from 13 through 15.5. The behaviour is consistent in that it never works in debug and always works in TestFlight. Thanks, Alex
Posted
by
Post not yet marked as solved
0 Replies
131 Views
Hi, I've recently faced with an issue while dealing with PushKit and CallKit. Everything was working fine before adding a socket connection method to my code. I want to be connected to the socket before calling reportNewIncomingCall so I adjusted my code accordingly. Then I realized that completion block of reportNewIncomingCall is not being called. I don't understand why, any thoughts? The part of didReceiveIncomingPushWith delegate method, mentioned above: func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { . . .             Log.addedCallInfotoAppDelegate.add("callID: \(String(describing: callID!)) callerName: \(callerName) uuID: \(String(describing: self.uuID!))")   let semaphore = DispatchSemaphore(value: 0)                 self.connectSocket { success in                     if success {                         Log.socketSuccessfullyConnected.add()                     } else {                         Log.errorWhileConnectingSocket.add()                     }                     self.update.remoteHandle = CXHandle(type: .phoneNumber, value: callerName)                     self.update.hasVideo = false                     self.update.localizedCallerName = callerName                     self.update.supportsGrouping = false                     self.update.supportsUngrouping = false                     self.update.supportsHolding = false                     self.provider.reportNewIncomingCall(with: self.uuID!, update: self.update) { error in                         Log.doneReporting.add()                         if error == nil {                             Log.didReportIncomingCall.add()                             if !stateCheck {                                 self.provider.reportCall(with: self.uuID!, endedAt: Date(), reason: .answeredElsewhere)                                 Log.reportedEndedCall.add()                                 self.uuID = nil                                 self.callID = nil                                 Log.deletedCallInfoFromAppDelegate.add()                             }                             semaphore.signal()                         } else {                             Log.errorWhileReportingIncomingCall.add(String(describing: error))                             semaphore.signal()                         }                     }         } else {             semaphore.signal()         }         semaphore.wait()         completion() }
Posted
by
Post not yet marked as solved
1 Replies
130 Views
As the title, I just want to receive a VoIP message, then do something. But it seems to be necessary to do reportNewIncomingCall in didReceiveIncomingPushWith, and it will make the call shows up. Can I cancel the call before it shows up ?
Posted
by
Post not yet marked as solved
0 Replies
143 Views
I am using push kit and call kit to send VOIP notificatin from my server to my app. The notification's working fine, however it remains there for infinite time unless the user rejects or accepts the call. Is there any way to handle this? Like it automatically expires after 20 seconds.
Posted
by
Post not yet marked as solved
1 Replies
255 Views
All our applications listed below, once installed in padOS15 (iPad mini 6 15.4.1) are not receiving any remote push notifications. We built our apps in XCode13.2.1. I also tried to install the latest XCode13.3.1 in macOS Monterey, but I got the same problem. It has no problem when installed on different devices and versions. Our apps: CLOMO SecuredBrowser for iFilter CLOMO SecuredMailer CLOMO SecuredDocs CLOMO SecuredContacts This is how to replicate it: Start the app Press the home button and the app goes to the background I change the profile settings on our server-side Wait for the remote push notifications. (the remote push notifications are received on other devices but not on this device) Expected result: remote push notifications should be shown on the device. When I checked the console log, I found that com.apple.Preferences removed delivered notifications as shown below. SpringBoard [com.apple.Preferences] Removing delivered notifications
Posted
by
Post not yet marked as solved
0 Replies
123 Views
I just placed a test where I've tested my site on different platforms. It's doing well on Andriod devices but not showing responsiveness on ios devices. What are the possible reasons for this???
Posted
by
Post not yet marked as solved
1 Replies
225 Views
I am working on an iOS app where VOIP push notifications are working as expected in the app foreground and background scenario. When the app is terminated by the user and lets say after 1 min the iPhone receives the VOIP push for my app, but the app is not launched in the background and therefore didReceiveIncomingPushWithPayload is never getting called. Can anyone please help me why am i seeing this behavior ? Thanks in Advance.
Posted
by
Post not yet marked as solved
1 Replies
206 Views
I'm developing Push Notification for our chat app. To enable Push Notification, our app will register the device token as well as some other information to another independent service, let's say "RegistrationService". Then any message going through the "RegistrationService" will know which device it should be sent to. Now my issue is - Since every registration record in "RegistrationService" has a TTL of 24 hour, our app will need to do another registration once the expiration time is reached. Currently I use the below codes in AppDelegate to start push notification and do the first time registration. I'm thinking if it is possible to resolve the above mentioned issue by embedding a "Timer". If so, can the timer work well when app is running in background? As we know, Push Notification offers a solution for client to receive the message when app in background. If the timer/registration auto-renew doesn't work in background, it can be a big issue. (From this post, https://developer.apple.com/forums/thread/127444, looks like the timer can't work when app is in background. If so, do you have any other recommended ways to achieve this?)     func application(     _ application: UIApplication,     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data     ) {         let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }         let token = tokenParts.joined()         print("Device Token: \(token)")         UserDefaults.standard.set(token, forKey: "APNSToken")         // Start push notifications         guard let apnsToken = UserDefaults.standard.string(forKey: "APNSToken") else {             print("Failed to get APNS token")             return         }         let semaphore = DispatchSemaphore(value: 0)         DispatchQueue.global(qos: .background).async { [weak self] in             guard let self = self else { return }             guard let chatClient = self.chatClient else { return }             chatClient.startPushNotifications(deviceToken: apnsToken) { result in                 switch result {                 case .success:                     print("Started Push Notifications")                 case let .failure(error):                     print("Failed To Start Push Notifications: \(error)")                 }                 semaphore.signal()             }             semaphore.wait()         }     }
Posted
by
Post not yet marked as solved
0 Replies
175 Views
Hello, I'm developing Push Notification on IOS 13 for our chat app. I want to achieve the below scenario - When the chat app is running in background and the device receives a chat message, (1) the user can see an alert banner popping up; (2) the app can receive the push notification payload inside this block - "application(_:didReceiveRemoteNotification:fetchCompletionHandler:)", which is in App Delegate. From this wiki (https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application), I assume these can be achieved. Now I succeeded in (1) but failed in (2). This "didReceiveRemoteNotification" can never be invoked when the app is in background... FYI - when the app is running in foreground, the "didReceiveRemoteNotification" can be called. Not sure if my testing method is correct...I connect my physical iPhone with the MacBook, open the program in Xcode and hit "run" button in Xcode to run this program. 3.Below please my notification template - "{"aps":{"mutable-content":1,"sound":"default", "alert":{"title":"New Message"}},"data": "customized content"} I'm not sure if I will need to add "content-available: 1" as well. Thanks for your answer!
Posted
by
Post not yet marked as solved
0 Replies
148 Views
Hi All I recently found that wrong deactivate audio session event was received on app when user end Celluar call. Here is my step: App report to CallKit an incoming call and answer it. Device receive Celluar call, and user choose Hold/Accept. and app is notified by held action on Call Provider delegate. User end Celluar call. Expected : app is supposed to receive activate Audio session or unheld event Real result: app receive did deactivate event. which cause app to shut audio session. Can anyone correct on this scenario? Thanks,
Posted
by
Post not yet marked as solved
0 Replies
212 Views
Hi All, I am using silent push data notifications in my iOS App which is used to process some information (not making any API call when silent push is received, just parsing some json dictionary to update state on UI) in background & display data to user. I was conducting some performance test to observe the reliability of silent push notifications for my App & observed the following: I was testing silent push notifications on 5 iPhone devices Only 4 out of 5 iPhones received this silent push In order to see if the iOS itself is blocking these notifications I have reset the settings of iPhone from settings app & this 5th iPhone started receiving silent push notifications without any issues I know silent push notifications are not guaranteed since they have a low priority than visible push notifications & depends on network conditions of my iPhone. I have ensured all the iPhones I was testing were on WiFi with strong internet connection, not on a low power mode, to ensure the push reliability. Please suggest me what exactly I am doing wrong in my setup, as some of the iPhones I am testing suddenly stops receiving silent push notifications for my mobile App & they are back to normal after I reset the settings of iPhone from settings App. I have tried various things like: Setting the apns-push-type header Setting apns-topic Setting apns-priority None of them seem to work. Only resetting the settings from settings App is bringing my mobile app to normal state to receive silent push notifications. Not sure at this point what is making my Mobile App to suddenly stop receiving silent push notifications. Below is the setup I have for my push notification delivery (My company Notification server) -> (Firebase Cloud Messaging Server) -> APNS -> (My Mobile App) All My iPhones are on iOS 15.2 & above I really appreciate any help from any of you, as this is a critical issue that is blocking my production app & I ran out of options trying to fix this issue.
Posted
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
Post not yet marked as solved
0 Replies
186 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