iOS Autologedout - 应用程序在返回时瞬间显示用户屏幕

标签 ios timer

我正在开发密码管理应用程序。我的团队使用以下 SO 引用来了解如何在一定时间(由用户在设置中选择)后注销用户并将用户直接带回登录页面: iOS perform action after period of inactivity (no user interaction)

我们遇到了一个问题。当用户离开应用程序时,应用程序会自动注销,然后用户导航回应用程序,它会在一瞬间显示用户之前所在的页面。对此进行测试,我能够在那一瞬间捕捉到该页面的照片。这会造成一个安全漏洞,因为该应用程序会在一瞬间显示私有(private)信息,并且可以在照片中捕获!

有没有人有任何建议、链接或示例代码来确保如果您在离开应用程序后导航回应用程序并且应用程序已在后台注销,应用程序将立即显示登录页面?

最佳答案

摘自《iOS App 编程指南》:

What to Do When Moving to the Background

Apps can use their applicationDidEnterBackground: method to prepare for moving to the background state. When moving to the background, all apps should do the following:

Prepare to have their picture taken. When the applicationDidEnterBackground: method returns, the system takes a picture of your app’s user interface and uses the resulting image for transition animations. If any views in your interface contain sensitive information, you should hide or modify those views before the applicationDidEnterBackground: method returns.

敏感应用程序的一种解决方案是在 applicationDidEnterBackground: 中抛出一个空白屏幕。当用户返回应用程序时,他们会看到一秒钟的空白屏幕,而不是敏感数据。当然你需要移除applicationWillEnterForeground:中的黑屏。

关于iOS Autologedout - 应用程序在返回时瞬间显示用户屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18675530/

相关文章:

ios - 如何在不使用 seagues 到 UIPopover 的情况下获得 Storyboard 创建的 UIViewController?

ios - 每个 UIView 的边框

javascript - 在带有主文件的ASP.NET 2.0页面上使用Java Timer

c# - 如何在c#中设置定时器在特定时间执行

swift - 在特定时间运行计时器(快速)

delphi - 日期/时间操作 - 友好的倒计时字符串

c# - Windows 服务内存使用量增加

ios - 如何为等间距按钮添加 Storyboard约束

iphone - 我如何从苹果崩溃报告中找到内存位置?我的应用程序崩溃的地方。?

ios - 通过传递数据。导航 Controller