问题
I'm looking for solutions but I has find nothing yet. My app receives only VoIP pushes and after iOS 13 I'm not able to receive push when the app is in background mode anymore. I looked other questions but I was not able to solve my problem with solutions proposed. There's someone who can help me?
On iOS 13.0 and later, incoming Voice over IP calls must be reported when they are received and before the didReceiceIncomingPush() method finishes execution, using the CallKit framework, or the system will terminate your app.
Repeatedly failing to report calls may prevent your app from receiving any more incoming call notifications.
Basically, you can no longer use VoIP pushes for non VoIP messaging, and will need to use regular push notifications for those.
I read this announce but in my app for particular types of push VoIP I can't use function reportNewIncomingCall()
because it requires params like: uuid, handle, hasVideo ecc.
And these params are not present in the payload.
回答1:
Since iOS 13 you can only use VoIP pushes for reporting incoming calls. For pushes that are not incoming calls, you must use other alternatives (take a look at this answer here).
Repeatedly failing to report calls may prevent your app from receiving any more incoming call notifications.
From my tests, it seemed to block all VoIP pushes after failing to report only 2 or 3 times, and it would stay blocked for around 24h.
because it requires params like: uuid, handle, hasVideo ecc. And these params are not present in the payload
If you receive a VoIP push for a new incoming call, but stil don't have the required info you listed above, you can initialize the call with "dummy" values, and later update them. As for example, setting the remoteHandle to CXHandle(type: .generic, value: "Connecting...")
and later updating it with the correct value:
cxCallUpdate.remoteHandle = CXHandle(type: .emailAddress, value: "email@mail.com")
cxProvider.reportCall(with: callUid, updated: cxCallUpdate)
回答2:
This is not a payload issue. You can create your own payload. Just you have to call below function in this callback.
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void)
Otherwise, Apple is blocking push notifications for a time.
provider.reportNewIncomingCall(with: uuid, update: update) { error in
completion() }
来源:https://stackoverflow.com/questions/58911755/reason-killing-app-because-it-never-posted-an-incoming-call-to-the-system-afte