I am downloading the data at background from server in an offline app, where the data will be downloaded when the app launches for the first time .Later the app will be used as offline app.
I need to place the condition to check whether the data couldn't be downloaded due to low battery, Network issues etc.
Where Can I handle these in app life cycle?
You can check
[[UIDevice currentDevice] batteryState]
if device is chargingAlso you can get battery level via
[[UIDevice currentDevice] batteryLevel]
and decide to download content or not.Note that batteryLevel is not so accurate, it rounded to 0.5
If you need more accurate measurements have a look https://github.com/nst/BatteryChart