Core Bluetooth Not Launching App in Background

We have an App that advertises a peripheral and we're using Core Bluetooth's State Preservation and Restoration feature. Most of the time, an incoming connection from a Central device causes the App to be launched and work as expected. However, there are times when an incoming connection starts to launch (or resurrect) the App but fails to do so.


Going through the sysdiagnose logs reveals that shortly after an incoming connection the OS decides to resurrect the App followed by a message which states "Application pending termination". Here's an excerpt from the sysdiagnose logs:


2019-10-09 07:23:47.669724 -0400 bluetoothd com.apple.bluetooth Incoming connection from device "35726F12-5D40-97B4-8115-254DD494B5B2" () with handle:0x109c00eb0 was successful with connection interval 6 active=1
2019-10-09 07:23:47.937680 -0400 bluetoothd com.apple.bluetooth (CBSR) Resurrecting zombie application "com.UniKey.KwiksetBeta"
2019-10-09 07:23:47.937699 -0400 bluetoothd com.apple.bluetooth (CBSR) Starting Resurrection Timer <15> for "com.UniKey.KwiksetBeta"
2019-10-09 07:23:47.937814 -0400 bluetoothd com.apple.bluetooth (CBSR) Application pending termination, delaying resurrection - private


Has anyone seen this? Any suggestions on how to go about troubleshooting this?

Replies

Can you see any more information about the attempting connection that may be different from the previous success connections?

For example, is there a change to the UUID of the peripheral or is the RSSI extremely weak in this instance?


Are you able to see after: `(CBSR) Application pending termination, delaying resurrection - private` pertaining to the application or the connection? Are there any other system logs that show power or CPU being diverted to other applications during the time the connection is trying to be established?