Is there any equivalent of Android services in iOS?

I want to check the database in my application every 12 hours for rows with a date column with a corresponding date. This is achieved by writing a service in android. But is there any equivalent service in iOS so that my requirement can be met?

+7
source share
3 answers

Not. There is no such thing in the SDK or iPhone / iPad at all. You can write only code that will affect the ecosystem of the application, and not the operating system. When your application is closed, it is closed and no action will be taken until the user opens it / opens the push notification associated with your application.

If a user has approved location-based services for your application, there are several ways to perform a short background process, even if your application is completely closed. One of them is using area- based form monitoring , which basically means that the user has left area X / input area Y, open the application and run a few commands before closing it again.

The smart way (and the only way I can think) to do what you need in iOS is to run this service on the server and pull data from the server when you open the application.

+7
source

You can find the solution here. Performing a background does this.

http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

Added: Apple does not allow applications to run in the background all the time. It provides some finite time to complete your application. You can increase this time depending on your performance. But this is not recommended.

+2
source

In iOS7 and later, you can use background selection for this task. You can check out this tutorial: http://code.tutsplus.com/tutorials/ios-7-sdk-working-with-background-fetch--mobile-20520

+2
source

All Articles