简体   繁体   中英

Several issues considering an iPhone wake-up light app

I want to build an iPhone app, it's a simple concept. You know those wake-up lights, that function as an alarm clock but then with a fading light? That's what I want for an app.

There are two issues: screen locking and brightness setting. First of all, I like to prevent the screen from locking so the wake-up animation is still visible when you actually wake up. Second, I would like to set the brightness of the screen so when sleeping the screen is dim, but when waking the screen fades to a brighter level.

Unfortunately, I read all around the internets which stated that this impossible. You can prevent the app from locking with one single line of code, but you can't set the screen brightness programmatically without using a private api (which is not allowed for publishing).

Is there some sort of work-around to programmatically show the application on the screen when the alarm triggers, circumventing the lock screen? Could this perhaps be achieved with a local notification? Is there some other sort of nifty code to make the screen as dark as possible when sleeping, but putting it back to life (showing the app) when waking?

I hope some bright folks out here can help me out, because so far my concept seems impossible. Mucho kudo's for the chap that can help me out!

Bye,

Reinder

简单的答案:使用iOS SDK的当前公共API根本无法实现您想要的。

The wake up screen isn't possible using public APIs.

You can simulate turning the brightness down (and back up) in your app by simply painting the entire view black, or using very very dark colors (and displaying no status bar or a black status bar). But note that turning off the auto-lock timer all night may kill the users battery.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM