Detect screen on/off from iOS service

后端 未结 3 1984
盖世英雄少女心
盖世英雄少女心 2020-11-30 03:38

I am developing a network monitor app that runs in background as a service. Is it possible to get a notification/call when the screen is turned on or off?

It exists

3条回答
  •  孤街浪徒
    2020-11-30 03:54

    While iPhone screen is locked appdelegate method "- (void)applicationWillResignActive:(UIApplication *)application" will be called you can check that. Hope it may help you.

提交回复
热议问题