Skip to content

Commit

Permalink
fix: ios double kill
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-peruzzo committed Sep 28, 2022
1 parent 3e4ca2a commit 1e21c24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
let nc = NotificationCenter.default
nc.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
nc.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
self._checkCancelDelay(killed: true)
nc.addObserver(self, selector: #selector(appKilled), name: UIApplication.willTerminateNotification, object: nil)
self.appMovedToForeground()
}

Expand Down Expand Up @@ -506,6 +506,10 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
}

}

@objc func appKilled(){
self._checkCancelDelay(killed: true)
}

private func installNext() {
let delayUpdatePreferences = UserDefaults.standard.string(forKey: DELAY_CONDITION_PREFERENCES) ?? "[]"
Expand Down

0 comments on commit 1e21c24

Please sign in to comment.