QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
396 stars 358 forks source link

ios13 voip push background issue #1189

Closed jinsu3758 closed 4 years ago

jinsu3758 commented 4 years ago

New Issue Checklist

Environment details

Info Value
iOS Version 13.2
Quickblox iOS SDK version 2.17.4
QuickbloxWebRTC SDK version 2.7.4
Xcode Version Xcode 11.3
Repro with our demo sample does it happen with our demo sample? - Yes

Did this work before? No, Occurs after version 13 update. On iOS 13.0 and later, when you receive a voip push report a call to CallKit However, the latest release has no response.

Expected behavior not crash in the background

Actual behavior The app is crashing when it receives a call in the background or not running.

Logs

2020-01-08 11:50:13.198797+0900 Cheobanghaejum[2046:1495392] [ChatService]: RCV: <presence xmlns="jabber:client" to="102106958-76478@chat.quickblox.com" from="102106958-76478@chat.quickblox.com/43705B42-862E-4D55-ACCE-790F1524AAB3"/>
2020-01-08 11:50:17.090102+0900 Cheobanghaejum[2046:1495285] Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
2020-01-08 11:50:19.815955+0900 Cheobanghaejum[2046:1495285] ZCallManager - get push
2020-01-08 11:50:19.816830+0900 Cheobanghaejum[2046:1495285] Apps receving VoIP pushes must post an incoming call (via CallKit or IncomingCallNotifications) in the same run loop as   pushRegistry:didReceiveIncomingPushWithPayload:forType:[withCompletionHandler:] without delay.
2020-01-08 11:50:19.816950+0900 Cheobanghaejum[2046:1495285] *** Assertion failure in -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes], /BuildRoot/Library/Caches/com.apple.xbs/Sources/PushKit/PushKit-37/PKPushRegistry.m:343
2020-01-08 11:50:19.817804+0900 Cheobanghaejum[2046:1495285] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Killing app because it never posted an incoming call to the system after receiving a PushKit VoIP push callback.'
*** First throw call stack:
(0x1a3c16a48 0x1a393dfa4 0x1a3b18e88 0x1a3f4e6c4 0x1b7937a5c 0x10644ebd8 0x10645d858 0x1b79369cc 0x10644d7fc 0x10644ebd8 0x10645cc34 0x1a3b945e4 0x1a3b8f5d8 0x1a3b8eadc 0x1adb14328 0x1a7c89ae0 0x10053b35c 0x1a3a18360)
libc++abi.dylib: terminating with uncaught exception of type NSException
Title for logs ```logos 2020-01-08 11:50:19.816950+0900 Cheobanghaejum[2046:1495285] *** Assertion failure in -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes], /BuildRoot/Library/Caches/com.apple.xbs/Sources/PushKit/PushKit-37/PKPushRegistry.m:343 2020-01-08 11:50:19.817804+0900 Cheobanghaejum[2046:1495285] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Killing app because it never posted an incoming call to the system after receiving a PushKit VoIP push callback.' ```

Steps to reproduce the behavior video call in the background or not running in sample-videochat-webrtc-swift

Any others comments In the demo code, I tried calling reportNewIncomingCall(with:update:completion:) from pushRegistry(_:didReceiveIncomingPushWith:for:completion:). but not synchronized with didReceiveNewSession(_:userInfo:). So I can't accept call right away

SwiftAmit commented 4 years ago

anybody got any Solution?

ghost commented 4 years ago

Hello @jinsu3758 @SwiftAmit

Please, be notified, that VOIP functionality has been deprecated by Apple in IOS 13, this is why it doesn't work on your side. Check the following article about what you should do in this case: https://developer.apple.com/videos/play/wwdc2019/707/

Have a good day!

jinsu3758 commented 4 years ago

Hi, Thanks for your reply. @QB-vladyslav-vyshniak

Doesn't the sample code respond to this issue? Even now, the demo sample 'sample-videochat-webrtc-swift' crashes the app in the background or not running

ghost commented 4 years ago

@jinsu3758 do you mean that after applying of the necessary points in the provided by Apple article QuickBlox clear sample crashes? Provide me with a detailed description of the issue, reproducing steps and detailed logs to investigate the issue.

ghost commented 4 years ago

The status of the ticket changed to "Closed" due to the absence of a reply.