1. Due to the recent site upgrade, the iPadForums (iPF) App will no longer work. The new iPadForums.net website has been designed from the ground up to work perfectly from any mobile, tablet, or desktop computer using the built in internet browser. Create a shortcut to iPadForums.net on your home screen by following these steps: Create an icon for iPadForums.net

Background work while app is "off"

Discussion in 'iPad Development' started by denn1s, Mar 10, 2011.

  1. denn1s
    Offline

    denn1s iPF Noob

    Joined:
    Mar 10, 2011
    Messages:
    6
    Thanks Received:
    1
    Trophy Points:
    0
    Location:
    London
    Ratings:
    +1 / 0
    Is it possible to make app working at background when it's actually not activated (via tapping) by user.

    For example i have an app, that runs cafe. And in this cafe chief is baking some food. When user disables app (running other apps, etc) i need baking to keep going and when dish is ready (for example remote server that serves app sends notification to user's iPad's Cafe-App) i want to send a notification to user saying "Your dish in Cafe-App is ready. Go and serve it before it get burn".

    Is it possible?
    Which approach i should use?
    Is there any topics/docs describing this problem?

    update.
    This looks like solution:
    developer(dot)apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html
    Last edited: Mar 10, 2011
  2. Tim SPRACKLEN
    Offline

    Tim SPRACKLEN iPad Legend

    Joined:
    Jan 3, 2011
    Messages:
    15,246
    Thanks Received:
    120
    Trophy Points:
    0
    Location:
    Scotland
    Ratings:
    +120 / 0
    The problem is that iOS 4.2 and 4.3 are not really ‘multi-tasking’ in the way that most users understand. In your PC or Mac, what you are suggesting is eminently possible. But iOS is really a ‘task switcher’ and moves tasks/apps in and out of RAM (system memory) and stores their context (state) so that, when they’re reloaded, they start up in exactly the same state as when they were removed from RAM. Only a very limited background activity is allowed by iOS - for example file download/upload, playing music etc. There are, of course, timer/alarm ‘notifications’ that an app can have pushed to the iPad’s screen - say by apps such as ‘Calendar’ or other task/project management/alarm apps, as well as games - so you could have your ‘Café’ app time how long a customer’s dish is going to take to cook and then push a ‘notification’ to the iPad screen when it’s ready (‘Mr. John Doe’s Lasagne is ready’) but this would be a simple timer-style app that would run independently of any external ‘agent’. Yes, it would ‘run’ if the ‘Café’ app had been offloaded by iOS, because iOS itself is responsible for handling ‘notifications’. But whether an external agent - the server you mentioned - could *externally* trigger such an event when the ‘Café’, I don’t think is possible because iOS aggressively ‘sandboxes’ (isolates) apps from each other (advantage - no virus infection possible in the iPad) and rigorously controls the app<->OS interaction.

    I’m sure that other more-experienced Forum members will be able to add much more to this argument.

    Tim
    Scotland
  3. Tim SPRACKLEN
    Offline

    Tim SPRACKLEN iPad Legend

    Joined:
    Jan 3, 2011
    Messages:
    15,246
    Thanks Received:
    120
    Trophy Points:
    0
    Location:
    Scotland
    Ratings:
    +120 / 0
    I should have mentioned that, if you’re interested in developing your own apps or simply reading about this in more detail, a good start is the Apple iPad Developer’s Page.

    Start Developing iPad Apps - Apple Developer

    There are, of course too, any number of books/eBooks available in iBooks or Amazon.

    Good luck with your very interesting idea.

    Tim
    Scotland
  4. denn1s
    Offline

    denn1s iPF Noob

    Joined:
    Mar 10, 2011
    Messages:
    6
    Thanks Received:
    1
    Trophy Points:
    0
    Location:
    London
    Ratings:
    +1 / 0
    hey Tim, thanx for answers

    Seems that iOS' Push Notifications system is the one that handles Pushes from outside the device (from some external server for example) and allows to implement my idea having dishes preparation be synced with external servers.

    and you're right about timing approach and using of internal notifications. this may fit when user disables network. in fact these two approaches can be combined =)
  5. Tim SPRACKLEN
    Offline

    Tim SPRACKLEN iPad Legend

    Joined:
    Jan 3, 2011
    Messages:
    15,246
    Thanks Received:
    120
    Trophy Points:
    0
    Location:
    Scotland
    Ratings:
    +120 / 0
    Sounds great - I'd love to know how you get on with this because I think there are a number of other Forum members who have been thinking of other apps that need this sort of external push.

    Oh - and don't forget to invite us to your cafe once you've implemented the idea!! :)

    Tim
    Scotland
  6. xavimm
    Offline

    xavimm iPF Noob

    Joined:
    Jul 26, 2011
    Messages:
    1
    Thanks Received:
    0
    Trophy Points:
    0
    Ratings:
    +0 / 0
    Hi all,

    thanks for the posts. I have in mind a similar idea and haven't found much around it. Glad to see your posts here.
    Similar to the cafe, what I would like to achieve is super simple:

    - I am thinking of an app able to run on the background and show pop up messages every x hours (i.e. 1 hour started says Hi!, after 1 more it says "How are you?" and so on... of course what I have in mind is a bit more interesting...

    The idea being:
    - This messages should be already preloaded in the app
    - Therefore no need for connectivity from internet

    Would appreciate a lot if, before I actually move forward with this using something such as the push notifications, anybody can give me some ideas on how to better achieve this. Would be also good if you know of a reference or library I can refer to in Xcode.

    THanks all

Share This Page

Search tags for this page
background app xcode
,
background timer task in xcode
,
background timer xcode
,
how to location when app background xcode
,
ipad app background activity
,
sample application that run in background iphone
,
update background timer xcode
,

xcode app running in background

,
xcode app working in background
,
xcode doesnt work in background
,
xcode ios run app in background
,
xcode keep app running in background
,

xcode run app in background

,
xcode timer in background
,
xcode timer while in background