I'm building an app in which one component is uploading/downloading data from an azure blob. I have been looking for ways to make this run in the background so that the processes aren't interrupted when the app is minimised or the phone is put to sleep. I don't need to support these processes when the app is killed. Is there a way to do this?
https://github.com/Azure/azure-storage-ios/issues/81 was the only relevant thing I could find, and it doesn't offer much.
Does anyone know how this can be done?
Related
This might be asking for the moon but here goes...
Is it possible to have an iOS app receive data and then forward it all while running in the background?
We're a restaurant currently using an ordering system that uses a main iPad as the till, with a second iPad in the kitchen to receive orders, and another third iPad used by the servers to take orders. Orders are sent to the main till which relays orders to the kitchen.
Works great... Unless someone switches app on the main till iPad to our other (necessary) hosting app, then all hell breaks loose and all orders stop getting sent.
Developer (small team) has told us it's impossible to solve but I have done some digging into recent Apple APIs that allow simple tasks to run in the background and have seen a few promising options, or perhaps it's possible via the External Accessory Framework, or even syncing via iCloud? A question for the more knowledgable than me, but is there currently a workaround to solve this that I could suggest or are they right in that it's currently impossible in iOS?
Yes there are ways to have an app in the background receive data, generally using either:
beginBackgroundTaskWithName:expirationHandler:
or
beginBackgroundTaskWithExpirationHandler:
Take a look at the Background Execution section in the documentation for more info...
I am building an Ionic application and one of the features involves taking down the notes in the app. The notes taking can be performed when the app is offline. The data is stored in the local storage.
Now, I want that when the customer comes online the data that is stored in the local storage (PouchDB) is pushed to the server. The problem is that the app might not be in the foreground. The app can be in suspended state. How can I wake the app up when the user comes online and then push the data to the server or perform any task?
I would be interested in hearing the Ionic approach and also native approach. Thanks
Your problem can be solved with Data PushNotifications in IONIC...
http://ngcordova.com/docs/plugins/pushNotifications/
I am building an app for iOS 7 that allows the user to select pictures and upload these to a server. In a perfect world the user would choose the pictures, press upload and be able to close the app.
I looked in to NSURLSession to establish this but it seems to only take a file. Is there any way i can send my NSData like in a NSURLRequest? Also, when not connected to the internet, is there any way i can make the app poll for an internet connection in the background and make it send the pictures when connection is established? I don't think was possible using earlier versions of iOS but iOS 7 seems to have some new options regarding background tasks.
Thanks in advance for any help!
A couple of thoughts:
You are correct that background uploads must use a file. So just save the NSData to a file (e.g. with writeToFile method), and then use that file path.
Regarding checking for Internet connection, the background NSURLSession takes care of that for you, so, no, you don't have to do that.
Regarding background uploads in earlier iOS versions, you could initiate the upload, but explicitly request a little more time to complete this finite-length task while the app runs in the background with UIBackgroundTaskIdentifier. See Executing a Finite-Length Task in the Background discussion in the App States and Multitasking section of the iOS App Programming Guide.
This isn't quite as robust as the new background NSURLSession functionality (which is more clever about applying discretionary logic so your app doesn't significantly adversely affect foreground apps, controlling whether it's permissible to do the upload over cell connection, allowing longer-length requests, working even if your app was terminated (for example, due to memory pressure), etc.). But UIBackgroundTaskIdentifier is a possible solution for iOS versions prior to 7 where you want to give an upload request a chance to complete even though the user has left your app.
Re: your comment about the "GOOD Dynamics SDK", I looked at it quickly. It does allow SDK-based app-to-app document sharing. I don't know if that means it writes a single encrypted on-disk file in the process, or if it uses an encrypted folder to store everything. If you had iOS access to that file, and a way to decrypt it on the server, then you'd have a chance of using the file-based background upload magic.
i have created an phonegap app for IOS that tracks the position of the user. At this time it is possible to use it in the Background. But if i like to upload theses data to an Server it will only work when the app is in the foreground.
Is it possible to call a js function in the Background or another way to transfer theses data to an REST Server in an continous Intervall, when the app is in the background?
I has searched for many times about this problem and i can't meantion that nobody has it in the past. I read many about plugins for phone gap, but don't understand how to create on that could help me.
Sorry for my bad english
In short no - IOS only has limited background processing for 3rd party apps.
You can get limited background processing with a VOIP app or using push notifications but I guess this isn't suitable for you
How many issues need to be considered carefully if a large of content need to be downloaded in an iOS app ?
Here are my known issues:
Network , No limits for Wifi, but Apple has limit policy for cellular network. enter link description here
Background execution. Apple introduced multitasking for several cases, but no for downloading large content background. Here is a good analysis.
Newsstand provides good solution for this. But does that mean you need follow the Newsstand approach ? We do not want to build an newsstand type app.
What else issues do you think ? and what is the best solution for this sort of problem ?
I would lazy load only data as needed. When the user requests an area load revenant data.
If you want to preload do it in the background. I have seen 1.6Gb apps with lots of videos, embedded in main bundle, but that was for sales app that needed to have all videos ready to go and could not assume any active network connection.
Download the data you need in a background thread while your app is running. If your app is terminated or suspended before you get all the data, resume where you left off the next time the app is running. There are a number of ways that you can do that; one good one is to break your data up into smaller chunks that can be downloaded sequentially.