当网络活动从无到有(以及相反的方式)时,我想要为我的iOS应用程序进行事件/回调.类似于Android对onDataActivity()的处理方式.我不是在谈论可达性,而是在数据实际开始或停止传输时.
该应用程序不适用于App Store,也不适用于越狱.我有一个类似的功能,通过使用检测屏幕何时开启/关闭工作
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center
NULL, // observer
displayStatusChanged, // callback
CFSTR("com.apple.iokit.hid.displayStatus"), // event name
NULL, // object
CFNotificationSuspensionBehaviorDeliverImmediately);
Run Code Online (Sandbox Code Playgroud)
以及其他事件
com.apple.springboard.hasBlankedScreen
com.apple.springboard.lockstate
Run Code Online (Sandbox Code Playgroud)
现在我想知道是否存在数据启动或停止传输的事件?或者,如果有人可以指出我可以通过上述方式监控的所有事件的完整列表的方向.