Test flight shows app pop-up without terminating the app (beginBackgroundTask issue)

192 views Asked by At

Some of the tester are getting App crashed pop-up while the app is perfectly working in the foreground. I have implemented crashlytics, but no crash log there. If I ask testers to submit feedback, appstoreconnect only shows device details, no crashlogs file.

Somehow I managed to collect crash logs from Analytics data in iPhone Settings. And this is what crashlogs say:

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, scene-update watchdog transgression: application<com.product.officeChat>:533 exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 15.730 (user 15.730, system 0.000), 57% CPU", | "Elapsed application CPU time (seconds): 9.107, 33% CPU" | )
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:

My app is a chatting app which includes functionality of sending messages in background. And my guess is that below code is causing these crashes

backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "MessageSenderFor\(channelID)", expirationHandler: { [weak self] in
            print("expiration block remainin time", UIApplication.shared.backgroundTimeRemaining)
            self?.isSendingMessages = false
            self?.endBackgroundTask()
      })

If anyone has ever faced such issue, please help me with some solution. I have been trying to figure this out for weeks without any solution.

0

There are 0 answers