1

大家今天的问候!!

我希望 iOS7 版本的 iOS 设备能够检测到锁。我对此做了很多研究,但没有找到适用于 iOS7 的任何解决方案。

例如,

在 iOS 7 中以编程方式锁定 iPhone 屏幕

锁定解锁事件 iphone

我已经为 iOS6 实现了相同的功能,但它不适用于 iOS7。

查看适用于 iOS6 的工作片段

 // coming back in the foreground
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note)
{
    // if user lock the screen 
    if ([[UIApplication sharedApplication] applicationState] == 1)
    {
          // coming back after unlocking screen..
    }
}];

我浏览了很多资源,发现在 iOS7 中没有任何解决方案。因此,我在这里发布了个人问题,让我知道是否有人知道如何在启用 iOS7 的设备上检测锁定事件。

任何帮助将不胜感激!

4

0 回答 0