[英]What can wake up an iOS app in the background when the device is locked?
[英]Wake app when iOS device plugged in to power
將iOS設備插入電源或從電源拔下時,是否可以在后台通知應用程序?
您需要兩個功能:
CFRunLoopSourceRef IOPSNotificationCreateRunLoopSource(IOPowerSourceCallbackType callback, void *context);
// to subscrive to a notification of a power source being changed
和
CFTypeRef IOPSCopyPowerSourcesInfo(void);
// to get info about your current power source
兩者都在這里描述: IOPowerSource
我不確定它是否可以在后台模式下工作,但是您可以嘗試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.