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?
Answering my own question.
When the push is received, I am checking for my call id to be valid with backend. It is obviously async, and it takes too long from background to handle, therefore iOS considering my app as "not reported the call in time".
I am not sure how do I manage the situation yet, but as for the issue itself - it is exactly because of my server call. Just commenting it out solved the issue completely.
TWIMC, if you're facing the same - check if you have any calls using async / closures in your PushRegistry didReceiveIncomingPushWith function code. It may help you to sort the issue out.