Want to kill iOS App while in suspended state - ios

I want to kill my application if it is in the suspended mode for more than 30mins so that when it relaunches it fetches new data. I have looked all over but wasn't able to find a solution to it. If anyone can recommend something it will be a huge help.
exit(0)
This above command is not recommended and apple will reject the application. Then there is the functionality of BGAppRefreshTask for iOS13 and above or minimumBackgroundFetchInterval for iOS less than iOS13, but still how to actually kill the application programmatically? Any help would be such a plus. Thanks

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 the IndoorAtlas ios SDK run in the background without the ios operating system kill it?

I'm looking for a solution for the following developing problem:
We are developing an ios (on iPhone, ios 8) application, based on the indoor positioning system, and we have found the IndoorAtlas geomagnetic solution. It is very good, but I don't know, how to solve that keeping running the IndoorAtlas in the background, if the user exit from the app or put the app in the background?
Thanks very much!!
This is not possible in normal application. Only certain type of applications can execute code in background, and even those are only woken up for the related callbacks of the application type.
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html
In your case, the location background mode could work.

App that works as iBeacon. How to be discovered even with the app has terminated?

I'm trying to use iBeacon in background mode and works fine, but I want that the app works when has been terminated by the system. It's possible to do this?
Thanks!
It is possible to write your app so it launches into the background when LocationServices sees an iBeacon, even if your app is terminated. See my answer here: https://stackoverflow.com/a/19128781/1461050
It should just work, unless the user removes the app. It's not the app itself that shows the beacon, it is the operating system showing the beacon on behalf of the app. That doesn't change when the OS terminates the app, only if the user does it.

How to persist communication after shutting down/turning on the device?

I'm developing an iOS application to keep track of certain system information from the device. The application is supposed to keep sending information even if it is in background. Everything is working fine but when I shut down the device and then turn it on, the application is still in background but it won't communicate the information. Can someone help me to become active my application after turning on the device?
when I shut down the device and then turn it on, the application is still in background
No, it isn't. The app launcher pretends that it is, but in reality it's been shut down. And there's no way you can re-open it programmatically (even less chance for opening a currently dead process from within itself....) - The only reasonable solution I could think of is jailbreaking the device and hooking into SpringBoard so it re-launches all open apps upon reboot, but I don't believe that's a viable option for you.
One way you could achieve this is by the application creating local notifications. These will persist through shutting down the device.
See this fine tutorial: http://www.icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/

Resources