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

Posts under PushKit tag

40 Posts

Post

Replies

Boosts

Views

Activity

Can't handle Push Notification when app is running in background
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!
0
0
850
Apr ’22
Wrong Deactivate audio session event was received when Ending cellular call
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,
0
0
706
Apr ’22
Unable to receive silent push notifications for my iOS App on certain iPhones, receiving push only after resetting iPhone settings from settings app
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.
2
1
1.2k
Apr ’22
VOIP incoming call 04/07
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,
0
0
639
Apr ’22
Device to device communication
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?
0
0
615
Apr ’22
Not receiving push notifications.
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", }, }, }
0
0
969
Mar ’22
CallKit green video dot reappears when app launches
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?
0
0
720
Mar ’22
End to end Encrypted workplace app background notification help
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
1
0
661
Feb ’22
Is it possible that the device token for Push notification will change while the app is running?
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,
1
0
748
Feb ’22
Question on how to write XCTest for an app used CallKit.
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.
0
0
1.5k
Feb ’22
Navigation push is not working in custom alert
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)      }
0
0
905
Feb ’22
App is only able to receive VoIP when in foreground, adhoc build
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?
3
1
2.7k
Feb ’22
didReceiveIncomingPushWithPayload completion handler
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?
2
0
1.3k
Feb ’22
Remove items in Fileprovider
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)             }         }     }
1
0
1.6k
Feb ’22
Using CallKit, how do I know from the outgoing side when the user has accepted the call?
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!
1
0
533
Jan ’22
.pem file gives ssl error
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
0
0
838
Jan ’22
Can't handle Push Notification when app is running in background
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!
Replies
0
Boosts
0
Views
850
Activity
Apr ’22
Wrong Deactivate audio session event was received when Ending cellular call
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,
Replies
0
Boosts
0
Views
706
Activity
Apr ’22
Unable to receive silent push notifications for my iOS App on certain iPhones, receiving push only after resetting iPhone settings from settings app
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.
Replies
2
Boosts
1
Views
1.2k
Activity
Apr ’22
VOIP incoming call 04/07
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,
Replies
0
Boosts
0
Views
639
Activity
Apr ’22
routines:OPENSSL_internal:SSLV3_ALERT_CERTIFICATE_REVOKED
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
Replies
0
Boosts
0
Views
892
Activity
Apr ’22
Device to device communication
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?
Replies
0
Boosts
0
Views
615
Activity
Apr ’22
Not receiving push notifications.
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", }, }, }
Replies
0
Boosts
0
Views
969
Activity
Mar ’22
CallKit green video dot reappears when app launches
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?
Replies
0
Boosts
0
Views
720
Activity
Mar ’22
UNNotificationServiceExtension lifecycle
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.
Replies
0
Boosts
0
Views
769
Activity
Mar ’22
Unable to enable notification badge.
I am trying to enable notification and badge on the top corner of IOS APP icon but NOT appearing. I am unable to enable notification badge .
Replies
0
Boosts
0
Views
513
Activity
Mar ’22
End to end Encrypted workplace app background notification help
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
Replies
1
Boosts
0
Views
661
Activity
Feb ’22
Is it possible that the device token for Push notification will change while the app is running?
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,
Replies
1
Boosts
0
Views
748
Activity
Feb ’22
Question on how to write XCTest for an app used CallKit.
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.
Replies
0
Boosts
0
Views
1.5k
Activity
Feb ’22
Navigation push is not working in custom alert
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)      }
Replies
0
Boosts
0
Views
905
Activity
Feb ’22
App is only able to receive VoIP when in foreground, adhoc build
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?
Replies
3
Boosts
1
Views
2.7k
Activity
Feb ’22
didReceiveIncomingPushWithPayload completion handler
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?
Replies
2
Boosts
0
Views
1.3k
Activity
Feb ’22
My app in background will crash on iOS 15.2 upon Receiving VoIP Push occasionally
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)
Replies
1
Boosts
0
Views
1.6k
Activity
Feb ’22
Remove items in Fileprovider
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)             }         }     }
Replies
1
Boosts
0
Views
1.6k
Activity
Feb ’22
Using CallKit, how do I know from the outgoing side when the user has accepted the call?
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!
Replies
1
Boosts
0
Views
533
Activity
Jan ’22
.pem file gives ssl error
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
Replies
0
Boosts
0
Views
838
Activity
Jan ’22