     override func viewDidLoad() {
         super.viewDidLoad()
         _updateButtonUI()
+        NotificationCenter.default.addObserver(
+            self,
+            selector: #selector(_onAppEnterBackground),
+            name: NSNotification.Name.UIApplicationDidEnterBackground,
+            object: nil
+        )
     }
 
     override func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.
     }
-    
+
     private func _listenForDeviceActivity() {
         NotificationCenter.default.addObserver(
             self,
             selector: #selector(_updateLockScreenStatus),
-            name: Notification.Name(rawValue: "lock_state_changed"),
+            name: LockStateChangedNotification,
             object: nil
         )
         

//

import UIKit

class TestViewController: UIViewController {


                    print("received notification: \(name!)")
                    NotificationCenter.default.post(
                        Notification(
                            name: LockStateChangedNotification
                        )
                    )
            },
            //"com.apple.iokit.hid.displayStatus" as CFString!,
            //"com.apple.springboard.lockcomplete" as CFString!,
            "com.apple.springboard.lockstate" as CFString!,
            //"com.apple.springboard.hasBlankedScreen" as CFString!,
            nil,
            CFNotificationSuspensionBehavior.deliverImmediately
        )
    }

    private func _stopListeningForDeviceActivity() {
        NotificationCenter.default.removeObserver(
            self,
            name: LockStateChangedNotification,
            object: nil)
    }

    @objc func _onAppEnterBackground() {
        print("Say... app entered background")
    }

    @objc func _updateLockScreenStatus() {
