Thanks for your answer crystal_matrx
All is done in the main thread, init and queue.
As I wrote, the VoIP token and the PushKit notification are not delivered in the app in time, so CallKit cannot be called (and that before it happens too many times and PushKit stops waking up the app).
After more research and speaking with Apple Developer Technical Support there seems to be 2 problems, linked with the app startup time:
1 - Too much time spent in AppDelegate didFinishLaunchingWithOptions
Delaying all services creation (firebase etc.) to later (like in viewDidAppear of initial UIViewControler) helped to display CallKit more often, but not always because of the second point.
2 - Too much time to reach AppDelegate didFinishLaunchingWithOptions
Using profiling and AppLaunch, on my old device dyld can take a lot of time and sometime according to logs the app doesn't even reach didFinishLaunchingWithOptions before being killed by callservicesd.
This part is still not clear, that can be due to being in a debug environment, making build configuration as "Release" and disabling as many options as possible did not help.
So even if point 1 helped, on a slow device unplugged with locked screen, the app being killed and a few heavy apps started before, sometime VoIP pushes still do not reach the point to display CallKit.
Maybe a full release build will solve the problem of point 2., something I could not try yet using TestFlight due to VoIP backend not being in prod yet.
Topic:
App & System Services
SubTopic:
Notifications
Tags: