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 8235381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:47:22+00:00 2026-06-07T18:47:22+00:00

In my application i have some content to be downloaded from a server and

  • 0

In my application i have some content to be downloaded from a server and when the user starts a download and the app is in-active state the app is going into background state where the downloads are getting stopped and failed.In order to avoid this i tried implementing download continuation in background using “beginBackgroundTaskWithExpirationHandler“.This is working only for a certain of period of time and if the device is in background state/sleep mode for longer time,the downloads are getting failed.

In order to avoid the failing of downloads i thought of avoiding the device going into sleep mode while application is downloading content and implemented the same.

I have set the setIdleTimerDisabled to YES as soon as the download is started and reverted the property to NO after completion of download or failure of download.

[[UIApplication sharedApplication] setIdleTimerDisabled:Yes];

The application is restricted in going to sleep mode after a download is started but after completion of dowload,still the application is not going into sleep mode.

After a download is initated the application would never go to sleep mode.

Can some one help me in restricting the device to sleep only during the dowmload is happening.

TNQ

  • 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-06-07T18:47:25+00:00Added an answer on June 7, 2026 at 6:47 pm

    I had the similar problem on resetting screen brightness. From my research i found that after pressing home button OS take over the control and wont allow you to reset brightness,timer, etc.

    You can solve this problem in another way.Provide a local notification on download completed and in applicationWillEnterForeground write your code to enable timer

    - (void)applicationWillEnterForeground:(UIApplication *)application {
         [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
    }
    

    I got this from StackOverflow, but I forgot the link. Sorry.

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

Sidebar

Related Questions

I have an application that saves files downloaded from a server. These files are
I have some code to download a text file from a website. When the
I have a .net client app that needs to play some content (images, movies,
I have a xulrunner application and I've been trying to reference remote content from
I have a piece of code that allow users download file from server (document
I have just moved a web application to a windows server and having some
On our web application, we have loads of attachments, some static (from DB) and
I have an application with a UIWebView where I display some html content. The
I have a flash_helper that I inconveniently downloaded from some web tutorial, which is
In my application,i have some .strings files.And on a button click,which is on my

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.