I was able to sort out the issue by removing asset from project and adding it back. Seems like I had some sort of issues with my previously added assets, no idea what was it, but still removing/adding it helps. Issue can be now closed.
Post
Replies
Boosts
Views
Activity
...looks like the issue is linked to GoogleUtilities: we have v7.2 in our current build, however previous build was of v7.4, and - as I found out recently, there is an issue raised on GitHub (and the fix is in GoogleUtils 7.4.1 patch release)
It is still TBC now, we'll be checking in the next 1-2 days, and I will post some updates here. If indeed related to library version, then it has nothing to do with the app distribution (whatever if it is adhoc or appstore based).
UPD: after doing some research, I was able to find out more:
My app is reporting a crash of a below kind, if called while being in background or not started
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x180bd50fc __exceptionPreprocess + 220
1 libobjc.A.dylib 0x19940fd64 objc_exception_throw + 60
2 Foundation 0x18248f3ac _userInfoForFileAndLine + 0
3 PushKit 0x1b3a53d80 -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes] + 192
4 libdispatch.dylib 0x180847670 _dispatch_client_callout + 20
5 libdispatch.dylib 0x1808568c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 PushKit 0x1b3a52ee0 __73-[PKPushRegistry voipPayloadReceived:mustPostCall:withCompletionHandler:]_block_invoke + 540
7 libdispatch.dylib 0x180845924 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x180847670 _dispatch_client_callout + 20
9 libdispatch.dylib 0x180855b70 _dispatch_main_queue_callback_4CF + 944
10 CoreFoundation 0x180b8dd84 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
11 CoreFoundation 0x180b47f5c __CFRunLoopRun + 2540
12 CoreFoundation 0x180b5b468 CFRunLoopRunSpecific + 600
13 GraphicsServices 0x19c6e638c GSEventRunModal + 164
14 UIKitCore 0x1834fd088 -[UIApplication _run] + 1100
15 UIKitCore 0x18327b958 UIApplicationMain + 2092
16 Doctor 0x102eae2c8 main + 25288 (_hidden#331:18)
17 dyld 0x10315daa4 start + 520
My app never reports crashes and it works ok while in foreground.
I do suspect strongly it is crashing because of it - 3 PushKit 0x1b3a53d80 -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes] + 192
Still, it is not clear for me.
First of all, if I have a fault with incoming calls reporting somewhere in my app logic, it presumably will fail whenever it is on fore- or background, because it should (?) be working the same way. It is sitting in the same func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void)
Or, should I handle it somehow specifically? Is it the case that didReceiveIncomingPushWith payload is to be managed in some special way along with my app entering foreground? I found to reference to it from app docs.
Can anyone please help me with it?
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.
It is possibly a bit too late to reply, but still.
1st of all, PushKit is definitely works fine with adhoc builds. I am pretty confident it is, as soon as I am using adhoc builds on a regular basis with one of my apps. The issue is not with the build type - should be in the code changes you made, profiles you're generating, certificates you're using or backend settings to push.
Possible issues I was also facing / tips I used:
Make sure you're pushing to the same environment you're building for. You have to cover the case of pushing to production / sandbox apple services on your backend. I spend a number of hrs trying to figure the issue out before I realised I have to also fix my backend for prod.
Make sure you have all checkboxes on, proper certificates are used/included in adhoc build profile and settings. Good point is to check which profiles are installed on your testing device and clean up, then try again.
Although the backend is usually sending to different endpoints for sandbox/prod, AFAR registering to voip is the same on the app side for all possible cases. I can hardly imagine you can't get the token from adhoc build while dev build is fine (if again it is all set with certs/profiles/settings for your build). Simply NSLogging of some key points like "i got my token / print token / sent token to backend" can proof or disproof some of your assumptions here, just log events and look into device event log, might help you as well.
Also don't forget you have to report to CallKit on didReceiveIncomingPushWith, and the app is about to start crashing if you missed to do so, which might be hard to notice with adhoc build running in background mode.
Hope it helps a bit!