[英]Can a multitasking app receive a notification when the device unlocks the screen even if the app is in the background?
My app needs to perform a calculation every time the device unlocks. 我的应用程序需要在每次设备解锁时执行计算。 It's an app which the user launches intentionally and then enters background, similar like a pasteboard manager.
这是一个用户有意启动然后进入后台的应用程序,类似于粘贴板管理器。
How can it receive a notification when the device unlocks while the app is in the background? 当应用程序处于后台时,如何在设备解锁时收到通知? Is this possible?
这可能吗? The calculation is not heavy.
计算不重。 It just reads and writes a value from/to NSUserDefaults.
它只是从/向NSUserDefaults读取和写入值。
使用当前的SDK和公共API,即使您的应用程序在后台,也无法判断用户何时解锁屏幕...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.