How to let the app run at background even if it is closed ?!

Discussion in 'iOS Programming' started by mlibary, Jun 11, 2012.

  1. mlibary macrumors newbie

    Joined:
    Jun 11, 2012
    #1
    Hi every body;:rolleyes:

    I'm in the middle of a xCode project and I need to know that how can I make my iPhone app run at background even if the user close it !!! :confused:
    Like in reminder apps, it will remind you even if it is closed !!
    How can I do that ?

    Thanks in advance :D
     
  2. ArtOfWarfare, Jun 11, 2012
    Last edited: Jun 11, 2012

    ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    If you specifically want to make an app that pops up messages at specific times (like reminders,) you want to look up Local Notifications.

    If you want something else to run in the background, you may be out of luck, as Apple only allows a select few types of apps to run in the background. (off the top of my head, I think apple allows geo-fence notifications, local notifications, push notifications, VOIP, and music streaming tasks to run in the background. I might be missing one or two.)

    Here's a good apple doc to look at:
    https://developer.apple.com/library...cationsFlow/ManagingYourApplicationsFlow.html

    The whole doc is pretty relevant to what you want, but you'll especially want to focus on the last section called "Background Execution and Multitasking". They have lists of the types of activities your app is allowed to do in the background.
     
  3. mlibary thread starter macrumors newbie

    Joined:
    Jun 11, 2012
    #3

    Thank you very much :)
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Actually, push notifications are not really a background service but more of a iOS-level functionality. The app need not have been "backgrounded" in order to receive push notifications.
     
  5. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    Hmm... I suppose you're correct, there is a difference, or else Sparrow could have just used push notifications as they wanted in their app.
     
  6. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #6
    Opening Push Notifications will open your view, and you can send a dictionary with your Push Notification, which you can use to open a specific view right of the bat (even though you're newly opening the application).
     

Share This Page