Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:59:40+00:00 2026-05-23T01:59:40+00:00

Is it possible to keep a socket connection alive in background, to be able

  • 0

Is it possible to keep a socket connection alive in background, to be able to push new data and alert users at all times?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:59:41+00:00Added an answer on May 23, 2026 at 1:59 am

    The answer to this question is a definitive yes. If you are in the background state, then you can keep a connection open and process messages from a server.

    Unfortunately the complexity here is that you don’t have a lot of control over the state your application is in:

    • foreground – The user has tapped your icon and the app is running with the UI visible.
    • suspended – The user was previously running your app in the foreground, but suspended it by hitting the home button or receiving a call. Basically your app is ‘freeze dried’ and will remain inactive until it is resumed by the user (starting where it left off) or it is terminated by the OS (see below).
    • background – The app was previously running in the foreground but has moved to the background state as a result of something the user has done. Normally your app will move to the suspended state in this case, but there are things you can do as the developer to prevent the instant ‘freeze dry’ and go into the background instead (see below). Your app will also be in the background state if it is woken up for a significant change event.
    • terminated – Your app has been unloaded from memory and the next time it starts will be from scratch. This is what happens when you double click the home button and then tap the x next to your app icon. It moves the app from the suspended state into the terminated state. This will also happen if the OS decides it needs room for more recently running apps and your app has been suspended for a long time.

    So obviously the trick here is how do I stay in the background state as a long as possible. There are a couple of ways to do this:

    • Beg for more time – You can get up to 10 minutes of additional background processing when your app is closed if you ask for it.
    • Use UIBackgroundMode – You can declare youself a voip, audio or location app by adding the corresponding UIBackgroundMode value to the pList. There are special requirements for these types of apps which you can check out here.

    So these approaches are not without their own problems (getting approved on the store being one of them) and as such I tend to agree with the other answers that using push notifications is probably your best approach for notifying your users. With the notification improvements in iOS5 this is going to be the best user experience going forward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to keep each incoming socket connection in an array and use
Is it possible to keep all my database related configuration (hostnames, usernames, passwords, and
Is is possible to keep a single OAuth session available across multiple users? My
Is it possible to keep all the accordion tabs open on load? Here is
If it is possible to keep an Air for Android application alive during sleep,
i'm trying to understand how and if its possible to keep a session open
I want to change color of the UINavigationBar? Is it possible to keep different
Is it possible to always keep selected item in the middle of a listbox?
I keep seeing documentation saying that its not possible to send to a remote
As good developers we keep our code as standard compliant as possible to help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.