the app crashes about 10 seconds after it goes into the background
libsystem_kernel.dylib semaphore_wait_trap
100% 45 dyld start + 7116 [0x1825fa000]
100% 44 xxxx main + 76 (main.m:38) [0x104c14000]
100% 43 UIKitCore UIApplicationMain + 336 [0x18ae57000]
100% 42 UIKitCore -[UIApplication _run] + 792 [0x18ae57000]
100% 41 GraphicsServices GSEventRunModal + 120 [0x224975000]
100% 40 CoreFoundation _CFRunLoopRunSpecificWithOptions + 532 [0x185569000]
100% 39 CoreFoundation __CFRunLoopRun + 820 [0x185569000]
100% 38 CoreFoundation __CFRunLoopDoSources0 + 232 [0x185569000]
100% 37 CoreFoundation __CFRunLoopDoSource0 + 172 [0x185569000]
100% 36 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 [0x185569000]
100% 35 BoardServices BSServiceMainRunLoopSourceHandler + 224 [0x19c8b0000]
100% 34 BoardServices __BSSERVICEMAINRUNLOOPQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 [0x19c8b0000]
100% 33 libdispatch.dylib _dispatch_block_invoke_direct + 284 [0x1bcf40000]
100% 32 libdispatch.dylib _dispatch_client_callout + 16 [0x1bcf40000]
100% 31 FrontBoardServices -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 [0x1a4d45000]
100% 30 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 96 [0x1a4d45000]
100% 29 FrontBoardServices __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2.cold.1 + 352 [0x1a4d45000]
100% 28 FrontBoardServices -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 708 [0x1a4d45000]
100% 27 FrontBoardServices -[FBSScene _callOutQueue_maybeCoalesceClientSettingsUpdates:] + 128 [0x1a4d45000]
100% 26 FrontBoardServices __76-[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.129 + 380 [0x1a4d45000]
100% 25 UIKitCore -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 [0x18ae57000]
100% 24 UIKitCore -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 [0x18ae57000]
100% 23 UIKitCore -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 208 [0x18ae57000]
100% 22 UIKitCore __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.218 + 616 [0x18ae57000]
100% 21 UIKitCore -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 [0x18ae57000]
100% 20 UIKitCore _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 [0x18ae57000]
100% 19 UIKitCore +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 [0x18ae57000]
100% 18 UIKitCore __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148 [0x18ae57000]
100% 17 UIKitCore -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 244 [0x18ae57000]
100% 16 UIKitCore -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 608 [0x18ae57000]
100% 15 UIKitCore -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 212 [0x18ae57000]
100% 14 UIKitCore __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 252 [0x18ae57000]
100% 13 UIKitCore _UIScenePerformActionsWithLifecycleActionMask + 112 [0x18ae57000]
100% 12 UIKitCore __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke_2 + 512 [0x18ae57000]
100% 11 UIKitCore -[UIApplication _applicationDidEnterBackground] + 136 [0x18ae57000]
100% 10 UIKitCore +[UIViewController _performWithoutDeferringTransitionsAllowingAnimation:actions:] + 140 [0x18ae57000]
100% 9 UIKitCore __47-[UIApplication _applicationDidEnterBackground]_block_invoke + 256 [0x18ae57000]
100% 8 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 [0x182c3d000]
100% 7 CoreFoundation _CFXNotificationPost + 736 [0x185569000]
100% 6 CoreFoundation _CFXRegistrationPost + 436 [0x185569000]
100% 5 CoreFoundation ___CFXRegistrationPost_block_invoke + 92 [0x185569000]
100% 4 CoreFoundation __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 [0x185569000]
100% 3 CoreBluetooth -[CBXpcConnection _sendBarrier] + 188 [0x1c2254000]
100% 2 libdispatch.dylib _dispatch_semaphore_wait_slow + 132 [0x1bcf40000]
100% 1 libdispatch.dylib _dispatch_sema4_wait + 28 [0x1bcf40000]
100% 0 libsystem_kernel.dylib semaphore_wait_trap + 8 [0x22d5b6000]