Update VPN status after profile reinstall
Should now cover all scenarios.
This commit is contained in:
parent
976e47af64
commit
9292919816
|
@ -88,6 +88,7 @@ class ServiceViewController: UIViewController, TableModelHost {
|
|||
let nc = NotificationCenter.default
|
||||
nc.addObserver(self, selector: #selector(applicationDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil)
|
||||
nc.addObserver(self, selector: #selector(vpnDidUpdate), name: .VPNDidChangeStatus, object: nil)
|
||||
nc.addObserver(self, selector: #selector(vpnDidUpdate), name: .VPNDidReinstall, object: nil)
|
||||
|
||||
// run this no matter what
|
||||
// XXX: convenient here vs AppDelegate for updating table
|
||||
|
|
|
@ -37,7 +37,9 @@ class StandardVPNProvider: VPNProvider {
|
|||
init(bundleIdentifier: String) {
|
||||
self.bundleIdentifier = bundleIdentifier
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(vpnDidUpdate(_:)), name: .NEVPNStatusDidChange, object: nil)
|
||||
let nc = NotificationCenter.default
|
||||
nc.addObserver(self, selector: #selector(vpnDidUpdate(_:)), name: .NEVPNStatusDidChange, object: nil)
|
||||
nc.addObserver(self, selector: #selector(vpnDidReinstall(_:)), name: .NEVPNConfigurationChange, object: nil)
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
@ -264,4 +266,8 @@ class StandardVPNProvider: VPNProvider {
|
|||
|
||||
NotificationCenter.default.post(name: .VPNDidChangeStatus, object: self)
|
||||
}
|
||||
|
||||
@objc private func vpnDidReinstall(_ notification: Notification) {
|
||||
NotificationCenter.default.post(name: .VPNDidReinstall, object: self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,4 +53,6 @@ extension Notification.Name {
|
|||
static let VPNDidPrepare = Notification.Name("VPNDidPrepare")
|
||||
|
||||
static let VPNDidChangeStatus = Notification.Name("VPNDidChangeStatus")
|
||||
|
||||
static let VPNDidReinstall = Notification.Name("VPNDidReinstall")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue