I need to detect lock & unlock events in my swift iOS application.
I have tried using AppDelegate functions like UIApplicationProtectedDataWillBecomeUnavailable & UIApplicationProtectedDataDidBecomeAvailable to record the lock and unlock events respectively, but have found this to be inconsistent.
UIApplicationProtectedDataWillBecomeUnavailable is not called immediately after the lock event, and sometimes misses the event altogether.
Is there a different approach to this problem that guarantees detecting lock & unlock correctly every time?