Filip Němeček 5/25/2021

Checking if device is locked (or sleeping) in iOS

Read Original

This technical article explains how to programmatically check if an iOS device is locked (a proxy for the screen being off). It covers using `UIApplication.shared.isProtectedDataAvailable` in the main app and details a workaround for app extensions using Keychain accessibility settings to infer the device's lock state. It includes steps for configuring Keychain sharing and code examples using a Keychain wrapper library.

Checking if device is locked (or sleeping) in iOS

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser