I am building an app which uploads files to the server via ajax. The problem is that users most likely sometimes won't have the internet connection and client would like to have the ajax call scheduled to time when user have the connection back. This is possible that user will schedule the file upload when he's offline and close the app. Is it possible to do ajax call when the application is closed (not in background)? When app is in the background, we can use background-fetch but I have never faced a problem to do something when app is closed.
The short answer is no, your app can't run code after being terminated.
You can run code in your AppDelegate
's applicationWillTerminate
, but that method is mainly intended for saving user data and other similar tasks.
See this answer also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With