Q:

iOS: Is there an Apple Store acceptable way to check if screen is on/off?

I'm a beginner to iOS, and want to see if I can have an app note the time that the phone's screen turns on or off. This would basically always be running in the background. I've read a lot of solutions that will work for jailbroken iPhones, or use launch daemons that seem to not be accepted in the Apple Store. Is there any way to gather that info that Apple may be okay with? 
The closest thing I've seen seems to be the protectedDataAvailable property as a flag for if the screen is on or off, but I'm not sure how I could run this continuously in the background and save any time data.
Any help is appreciated, thanks so much!

A:

Not really. There are restrictions which app can run in the background, I think it's only allowed for voip apps, messengers and music players. All other apps can continue to run tasks in the background but get killed after 10 minutes if the task is not finished until then.
The available background modes for store apps: (Look for UIBackgroundModes)
https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW22
the app reviewer will check if your app fit's in the chosen category.

