How to validate flash light turned on/off in iOS/android devices using appium

I want to validate whether flash is on/off in iOS/Android devices.Can some one help me?