当iOS设备接通电源时唤醒应用程序
当iOS设备插入或拔出电源时,是否可以在后台通知应用程序?您需要两个功能:当iOS设备接通电源时唤醒应用程序,ios,Ios,当iOS设备插入或拔出电源时,是否可以在后台通知应用程序?您需要两个功能: CFRunLoopSourceRef IOPSNotificationCreateRunLoopSource(IOPowerSourceCallbackType callback, void *context); // to subscrive to a notification of a power source being changed 及 这里描述了这两种情况: 我不确定它是否能在后台模式下工作,但你可以试试
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