iOS keep thread running in background - ios

I'm developing an application only for company’s internal use.(iOS 5 and later)
The application does some tasks and then has a lot off calls to multiple web services.(Some information is read/write from core data).
The problem is that all calls together take longer than 10 min.
How can I keep a thread in background communication with web services forever? Can I create a new thread each 10 min?

Only certain types of apps can run in the background longer than 10 minutes.
In your case, you might want to look into "Background Fetch" mode, that is new to iOS 7.
See here:
iOS App Programming Guide

Related

TokBox iOS - App Background process singal not working

We are facing some strange issue in the iOS app , we are handling the signal when app in background mode.
It's perfectly working in xcode simulator and the same thing it's not working in real iOS devices. The signals not receiving in app background mode.
Do we need to enable any settings in iOS devices to handle this?
And, It's perfectly working in android devices.
Please help on this.
(Also Project->Capabilities-> Background Modes -> Audio,AirPlay,PIP is enabled for this to work in background.)
Apps sent to the background are generally expected to get suspended unless there is a reason for the process to stay running. In the case of using the OpenTok SDK, usually this means the app will be suspended unless there is a Publisher and/or Subscriber running -- background permission is tied to the AVAudioSession.
If you are trying to just keep a session connected without any subscribers/publishers while the app is in the background, this is not a recommended implementation. Keeping a websocket active for an OpenTok session requires trickling data every few seconds, creating an unnecessary burden on energy and data costs. For this reason, it is recommended to do your offline signaling via APNS rather than through an OpenTok session.
I trust you may have already seen this, but just for completeness, a more in-depth writeup on the topic is available here: https://tokbox.com/developer/sdks/ios/background-state.html
Disclosure: I work for TokBox.

iOS: run app as a service in background

Being relatively new to iOS App development, I wish to develop an app which runs like a service in background (comparable with android service). The goal of my app is to use the native voice recognition, also while the app is inactive. My question is, would it principally be possible to code an app to be able to run also in background? I've read in a few pretty old threads that iOS closes any app after three minutes. However, should it be possible, I would be thankful for any coding example.
I don't think so, because if the app is on background, the local audio recogisation is for Siri.

Can iOS apps communicate via sockets?

I'm going to develop few apps for iOS. Can they communicate to each other via sockets? Let's say one app runs as server (even in background mode) and another as client connects to server app and perform some communication. Does it violate any App Store rules? Any available IPC in iOS if my idea is not working for some reason?
Of course you can and it doesn't violate any rules.
Just just the CoreFoundation libraries.
There's no point in me describing it to you if it already has been all written in the official Apple documentation:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html
You can find here examples, all approaches and things you can and cannot do.
EDIT:
You didn't make that clear but it seems like you wanted the apps to run on the same device. You can do that but that would mean that one app has to run in background, and to do that you need some kind of hack (for example: background updating location mode ON) and that won't get past apple store. You need a very good reason to have your app ran in background (music in background, update location in background for fitness apps etc.)
Besides, it's a duplicate question:
iOS - Is it possible to communicate between apps via localhost?
As long as your apps are in the same app group, then yes, socket IPC is allowed. If not, then no. Sockets map to file descriptors (Berkeley sockets), and these files are sandboxed to the app or app group. More info: http://ddeville.me/2015/02/interprocess-communication-on-ios-with-berkeley-sockets

XCode/iOS Keep connection alive in background

In my app, I open a connection to use the iPad as a tiny FTP Server, then when the app runs, I can access to the app Documents with FileZilla, web browser, etc...
But can I keep this connection opened whe the app enter in background? I tried "Background Modes" but it doesn't work.
Thanks you all :)
EDIT : I use files from this project : https://github.com/sosoyososo/XZCodeBrowser
The background modes in iOS are limited. iOS devices are not designed to operate in the same way as a traditional computer, with multiple long-running tasks. There are various background modes available, as you have investigated, that can help applications perform tasks in the background, but these are more focussed on the user experience (e.g. allowing an app to periodically fetch data or receive location updates) than running "servers".
Apps in the background are managed to reduce demand for memory and maximise battery life, so they can be unloaded at any time.
The VoIP background mode allows iOS to keep listening for network traffic on your app's behalf and re-launch your app in the background if necessary, but if you use this for a non-VoIP app I believe you will have problems with app approval.

ios long running task in background task

In ios, it supports long running background task for certain types of apps with background modes such as App registers for location updates,App provides Voice over IP services,App plays audio,App processes Newsstand Kit downloads,App communicates using CoreBluetooth,App shares data using CoreBluetooth.
My application in ios will updload file to remote server periodically if network connection exists.It will do this process if the file is available in the particular directory.
I want to know that in which mode above my app does come under?
the background modes are very restrictive and your app doesnt fit in any category. if you want to use background downloading, try the following tutorial:
iOS 7 SDK: Background Transfer Service

Resources