is there any forground service in IOS just like android .Which cannot stop even application is not ruuning else Application is terminated by user.i want that my ios application always connect to my server and perform database read write operation on my database.
-
I don't why people down voted this? – Suryakant Sharma Oct 31 '17 at 08:53
-
Related: https://stackoverflow.com/questions/40449640/perform-background-tasks-when-app-is-terminated https://stackoverflow.com/questions/35449579/i-want-to-run-a-service-all-the-time-even-app-is-closed-killed-or-terminated-in https://stackoverflow.com/questions/39969261/run-code-after-the-app-has-terminated-possible-xcode-8-swift-3 https://stackoverflow.com/questions/46833053/how-to-run-swift-code-after-terminate-app https://stackoverflow.com/questions/33900590/swift-how-to-run-a-function-even-when-user-kills-the-app – Ahmad F Oct 31 '17 at 08:55
-
2@Suryakant probably because with a pretty simple check I found a bunch of related questions about this topic, as I mentioned in my "Related" comment. – Ahmad F Oct 31 '17 at 08:56
-
1Possible duplicate of [I want to Run a Service all the time Even App is closed,killed or terminated in Swift IOS](https://stackoverflow.com/questions/35449579/i-want-to-run-a-service-all-the-time-even-app-is-closed-killed-or-terminated-in) – clemens Oct 31 '17 at 09:05
2 Answers
No, there is no service or process that keep running after the app is terminated in the iOS.
App Termination
Apps must be prepared for termination to happen at any time and should not wait to save user data or perform other critical tasks. System-initiated termination is a normal part of an app’s life cycle. The system usually terminates apps so that it can reclaim memory and make room for other apps being launched by the user, but the system may also terminate apps that are misbehaving or not responding to events in a timely manner.
Suspended apps receive no notification when they are terminated; the system kills the process and reclaims the corresponding memory. If an app is currently running in the background and not suspended, the system calls the applicationWillTerminate: of its app delegate prior to termination. The system does not call this method when the device reboots.
In addition to the system terminating your app, the user can terminate your app explicitly using the multitasking UI. User-initiated termination has the same effect as terminating a suspended app. The app’s process is killed and no notification is sent to the app.
-
you have any authenticate documentation from Apple Guidelines. – Muhammad Haris Rafiq Oct 31 '17 at 08:53
Nope, You can't do it. This is one of the reasons why Apple devices continue to be faster regardless of their age.
But that's not the end of the story. You can hand over the responsibility to the OS. It's not going to be straightforward like you would do in Android but worth the try. You can try background fetch to download data when the app is not active in the foreground. Read the documentation here and then read this tutorial too.
PS: Btw even Android is imposing newer restrictions on the background services that you run in upcoming versions.

- 17,023
- 32
- 114
- 148