1

I am getting the following binary error after submitting to the App Store: "Unsupported operation - Apps are not allowed to listen to device lock notifications."

I am using Darwin notifications to monitor the device lock state but Apple has discouraged it. Another approach is to use protected data. But applicationProtectedDataWillBecomeUnavailable(_:) does work but only if the device is password protected. Is there any way to detect lock state if the phone is not password protected?

Luke
  • 4,908
  • 1
  • 37
  • 59
ikarma khan
  • 83
  • 1
  • 6
  • Possible duplicate of [Can we detect whether a user left through the home button or lock button without listening to darwin notifications?](https://stackoverflow.com/questions/44071009/can-we-detect-whether-a-user-left-through-the-home-button-or-lock-button-without) – TNguyen Sep 01 '17 at 15:22

0 Answers0