About GCD (Grand Central Dispatch) in an extension.

We are currently developing a VoIP application that supports Local Push extention.

I would like to ask for your advice on how the extension works when the iPhone goes into sleep mode.

Our App are using GCD (Grand Central Dispatch) to perform periodic processing within the extension, creating a cycle by it.

[sample of an our source]

class LocalPushProvider: NEAppPushProvider {
 
    let activeQueue: DispatchQueue = DispatchQueue(label: "com.myapp.LocalPushProvider.ActiveQueue", autoreleaseFrequency: .workItem)
    var activeSchecule: Cancellable?
    override func start(completionHandler: @escaping (Error?) -> Void) {
              :
        self.activeSchecule = self.activeQueue.schedule(
            after: .init(.now() + .seconds(10)),            // start schedule after 10sec
            interval: .seconds(10)                          // interval 10sec
        ) {
            self.activeTimerProc()
        }
        completionHandler(nil)
    }
}

However In this App that we are confirming that when the iPhone goes into sleep mode, self.activeTimerProc() is not called at 10-second intervals, but is significantly delayed (approximately 30 to 180 seconds).

What factors could be causing the timer processing using GCD not to be executed at the specified interval when the iPhone is in sleep mode?

Also, please let us know if there are any implementation errors or points to note.

I apologize for bothering you during your busy schedule, but I would appreciate your response.

About GCD (Grand Central Dispatch) in an extension.
 
 
Q