fix: CallKit crashes when in background - WPB-17848 #3061
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically cherry-picked based on the following PR:
Original PR description:
Issue
Context: When incoming calls arrive in the background and they're handled with CallKit, app crashes.
Causes: Some changes were introduced recently in this PR where we replaced
pushRetry
andreportNewIncomingCall
completionHandler versions of Apple's API with their async versions which appear to be broken as they're not called properly when waking up the app from the background.It ends up crashing as since iOS 13:
..which is what we experienced when looking at the console.
Solution: As mentioned in the latest comments in this SO post and after testing with both versions (async vs. completionHandler), the issue was reproducible with the async version and appeared to work properly with the completionHandler one.
Solution is to revert these changes to make sure we use the completionHandler API versions as before, thus properly report the call and avoid crashing.
Testing
Tested internally on both async / completionHandler versions, issue was reproducible on the async version, not the completionHandler one.
Checklist
[WPB-XXX]
.