I believe no such apps exist, unless you jailbreak your device.
Getting blue light-blocking glasses would fix this problem.
I've jailbroken my iPad on ios8 and run f.lux on that and all my macs. Haven't jailbroken my iPhone [yet].
Lots of threads and info on the forum for the glasses. I've been using them overnight for 18 months. Brilliant.
SUCCESS: A lot of little things done well
Found these - I think the iPhone one requires jail-breaking your phone, though:
f.lux - iphone
Twilight - android
Night Filter - ?
Another android one: https://play.google.com/store/apps/details?id=jp.ne.hardyinfinity.bluelightfilter.free&hl=en
Interesting -- found this petition to ask Apple to make this kind of setting an option:
Then there is this filter you can lay over the screen:
Petition signed, not many, think maybe needs a push on here!