If there is the following code for a notification service extension
var countOfInvocations = 0
public class NotificationService: UNNotificationServiceExtension {
public override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
NSLog("Push count: \(countOfInvocations)")
countOfInvocations = countOfInvocations + 1
Then if pushes are sent to the handset it can be observed in the console log that the value of countOfInvocations keeps increasing, meaning the NotificationService class is getting instantiated and destroyed within the same process. However at what point does that process get torn down by the OS? It seems to be kept alive for about 10 minutes or so. Is there a way the extension can detect its the same or a new process?