voice-quickstart-ios: iOS 13 App built on Xcode 11 Crashes when receiving call if the app is on background or killed
Description
I have a react-native application that use a home built component to handle Twilio communication.
We have upgraded to latest 5.x twilio iOS SDK and latest Android SDK.
On Android it works great. On iOS the calls work perfect when the app is in foreground but it fails when the app is killed and the phone locked.
I followed all the issues and the migration guides to no avail.
I’m sure there’s something wrong in the code as I’m experiencing what is described in issue #251 but I’m not sure what’s wrong.
When the phone is killed pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler is never called and then I get an error saying Killing VoIP app <private> because it failed to post an incoming call in time.
Steps to Reproduce
- Launch application in iphone with iOS 13.x and log in. Make sure Twilio is registered
- Kill the app and lock the phone
- Call the locked phone.
- Application starts in XCode Debug, but is killed with
Killing VoIP app <private> because it failed to post an incoming call in time.
Error.
Expected Behavior
That I receive a call
Actual Behavior
Nothing happens.
Reproduces How Often
Always
Versions
Voice iOS SDK
5.1.1
Xcode
11.3.1
iOS Version
13.3.1
iOS Device
iPhone 6s Plus
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 55 (26 by maintainers)
Do this first, Important!
Add below code is inside :
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void)
Use completion() in main thread.
provider.reportNewIncomingCall
insidedidReceiveIncomingPushWith
completion()
in main thread.These steps solved my problem.
@bchen-twilio thanks for your quick reply.
Please let me know if you need any further information.
Sure, I’ll do that and I will also use the same library in a new application without any other library to see if it works. Thanks @bchen-twilio