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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:25:06+00:00 2026-06-02T11:25:06+00:00

we have an app that has a specific purpose where an exit is required.

  • 0

we have an app that has a specific purpose where an exit is required. After the exit a process needs to run in the background for a certain amount of time or until finished. We just need to know how to programmatically force the app to enter the background where processes can continue running. Any help on this would be great! Thanks in advance!

UPDATE: We have confirmed that there does not seem to be a programmatic way to force the app to quit / enter background and continue running background tasks. You can force the the app to exit using exit(0); but this kills the app all together. However, the bulk of this question was concerning running tasks in the background. We have found a solution that allows our app to begin processing data and handling tasks that a user has setup to be processed. Here is the code required. This needs to be added to the app delegate and multitasking is required on the device / IOS.

- (void)applicationDidEnterBackground:(UIApplication *)app{
    // Check that IOS supports multitasking
    if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]){
        // Check that the device supports multitasking
        if ([[UIDevice currentDevice] isMultitaskingSupported]) {
        // Custom setting to allow users the freedom to enable or disable background tasks
        BOOL enabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundTasksEnabled_key"];
            if ( enabled ){
                //Get the shared application instance
                backGroundApp = [UIApplication sharedApplication];  
                background_task = [backGroundApp beginBackgroundTaskWithExpirationHandler: ^ {
                    [backGroundApp endBackgroundTask: background_task];
                    background_task = UIBackgroundTaskInvalid;
                }];

                // Run in background
                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

                    NSLog(@"\n\nProcess background tasks!\n\n");

                    // Do your work here

                });
            }
        }
    }
}
  • 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-02T11:25:09+00:00Added an answer on June 2, 2026 at 11:25 am

    You can force an iOS app into the background by sending a registered URL to another app to handle, such as a web site URL to Safari.

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: myWebsiteURL ]];
    

    Many many apps that call Safari to handle URLs are approved by Apple.

    To get any time in the background, an app has to be appropriately configured using one of the allowed background modes (audio, location or VOIP); or the app can request a few minutes of extra time in the background before being suspended by calling the beginBackgroundTaskWithExpirationHandler method

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

Sidebar

Related Questions

I have an app that has a bunch of Core Data that it needs
My app needs to have a intent-filter that responds to a Intent that has
To be more specific, I have an app that has multiple tableViews that drill
I have an app that has one Broadcast Receiver that listens for a specific
I have an app that has three tabs. They all do specific things. I
Have an app that has listings - think classified ads - and each listing
I have an app that has a centre view with two views off to
I have an app that has a tabbar at the bottom. When I select
I have an app that has a TableView, NavigationView and TabBar running together. There
I have an app that has a list of items. My customer prefers 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.