I need to code an iOS app that sends data to server every 30 minutes. Can this work when the app is in the background? How reliable it can be?
There is no way to perform tasks in the background permanently at the interval of time you are requesting. You may request specific permission via the developer connection but I must warn you that you will need a very compelling argument. I included the documentation below, maybe your request falls within one of the groupings that could run permanently. Or maybe you could use one of the long running background threads and adapt it in such a way that it fulfils the task you are attempting.
Directly from Apple's Documentation:
For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:
Apps that implement these services must declare the services they support and use system frameworks to implement the relevant aspects of those services. Declaring the services lets the system know which services you use, but in some cases it is the system frameworks that actually prevent your application from being suspended.
~/End of Line