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

  • Home
  • SEARCH
  • 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 3313236
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:05:30+00:00 2026-05-17T22:05:30+00:00

Assuming this is possible, I would like my iOS application, when backgrounded, to poll

  • 0

Assuming this is possible, I would like my iOS application, when backgrounded, to poll a server (i.e. essentially, retrieve the contents of a URL every 30 minutes and notify the user if it contains something “interesting”), essentially in a similar way to the way the built-in mail client assumedly works if you’re not using push notifications.

Now, from my reading so far (I’m an experienced programmer, but new to iOS), I think there may be two potential ways to do this:

  • Method 1: In applicationDidEnterBackground:, start a background task which does the periodic polling;
  • Method 2: Send your own app a UILocalNotification with no visible text to the user, but which simply serves to wake your app up in X minutes time to do the polling (and then send itself another notification for next tim etc).

I see in Apple’s documentation of Scheduling, Registering, and Handling Notifications, they actually seem to have an example usign Method 1 (their “chat” example, Listing 2-2). But what is surprising about this method is that it appears to just sit in a continual loop doing the polling, with no intervening sleep; on platforms I’m more familiar with, this would be inadvisable and would burn CPU.

So subparts of my question are essentially:
– Is Method 2 possible (or must a UILocalNotification always cause a visible alert to the user, which is not what I want) and if so is it the recommended way to do this?
– If the way to do it is Method 1, is Apple’s “chat” example of sitting in a continual loop actually OK (e.g. does iOS ration the CPU so that this isn’t an issue), and if not what is the way in iOS to tell the background process to “sleep for X seconds/minutes”? And if Apple’s continuous loop is OK for whatever reason, what would then be the way to time the intervals between polling?

N.B. I appreciate that being able to run in the background at all is essentially an iOS 4 feature. I don’t mind if my app will only run in iOS 4.

  • 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-17T22:05:30+00:00Added an answer on May 17, 2026 at 10:05 pm

    What you want to do, is not covered under the multitasking features of iOS4. There are only a few types of applications allowed to run in the background for long periods of time (more than 10 minutes), and generic networking applications aren’t one of them.

    However, all is not lost. What you can do, and what I believe you should do is to use push notifications. On your server, you link up with apple’s push notification service, the user registers for push notifications, and you either know what “interesting data” is, or they tell you. When that data is available, you send it to the user immediately via a push notification.

    It provides a nicer user experience, and your app doesn’t need to be running in the background. iOS will handle delivery of the push notification. If they swipe to unlock the phone when they get the notification, your app will open up, and at which time, you can load that useful information in your app.

    Your method 1 won’t work long term, even if you do manage to pause input for a while, and this is why: Launching a background task runs a task for NO MORE than 10 minutes, unless you are one of the three types of applications that is allowed to stay running. After 10 minutes, the OS will suspend you.

    Your method 2 won’t work at all. All local notifications present an alert view to users.

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

Sidebar

Related Questions

How do you go about building a complete keyboard-accessible web application? Assuming that this
Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
Hej, assuming I have a code that looks like this: List<User> userList = GetUserByName
Assuming network access is sporadic with no central server, what would be the best
Assuming this is a multi-user system
This follows on from this question where I was getting a few answers assuming
I was always wondering about this seemingly utopic world of open source. Assuming the
Assuming such a query exists, I would greatly appreciate the help. I'm trying to
Is this possible? i get weird error message when i put char as the
Assuming a regular <input type=text> text-box with data in it. Is it possible to

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.