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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:58:58+00:00 2026-06-17T15:58:58+00:00

I need to perform the simple task of calling a localNoification if the user

  • 0

I need to perform the simple task of calling a localNoification if the user enters or exits a region while the app is in background mode. Only a single set of coordinates will trigger the notification. For example:

Lat: 41.8500
Lon: 87.6500
Radius: 300

I know how to call the localNotification, and how to use the basic functionality of the locationManager, but cannot seem to track the location in the background. Any help would be great!

  • 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-17T15:58:58+00:00Added an answer on June 17, 2026 at 3:58 pm

    Have you read up on CLLocationManager’s startMonitoringForRegion: method? I think this will do exactly what you want. The code to set it up would look something like this:

    CLRegion * region = [[CLRegion alloc] initCircularRegionWithCenter: CLLocationCoordinate2DMake(41.8500, 87.6500) radius: 300 identifier: @"regionIDstring"];
    CLLocationManager * manager = [[CLLocationManager alloc] init];
    [manager setDelegate: myLocationManagerDelegate];
    [manager startMonitoringForRegion: region];
    

    After that, the device will monitor for entrances/exits to the specified region, even when your app is in the background. When a region is crossed, the delegate will receive a call locationManager:didEnterRegion: or locationManager:didExitRegion:. You can use this opportunity to post a UILocalNotification. If your app is not running at the time the region is crossed, it will be launched in the background, and you will need to look for the appropriate key in application: didFinishLaunchingWithOptions:. Use code like the following:

    if ([launchOptions objectForKey: UIApplicationLaunchOptionsLocationKey] != nil) {
        // create a location manager, and set its delegate here
        // the delegate will then receive the appropriate callback
    }
    

    Be aware that the app will only have a short amount of time to execute while running in the background (a few seconds); if you need to perform a longer task, call the beginBackgroundTaskWithExpirationHandler: method that Nebs mentioned in his/her answer immediately after your app is notified of the region crossing. This will give you about 600 seconds to run in the background.

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

Sidebar

Related Questions

Very simple question. I need to perform a task when the user closes his
In VIM, I need to perform a simple task - highlight ( and ).
I'm new to audio analysis, but need to perform a (seemingly) simple task. I
I have a simple task I need to perform in Python, which is to
I have a pretty simple SQL I need to perform. I have a ProcessUser
When I write math in LaTeX I often need to perform simple arithmetic on
This is probably a very simple task to perform but I'm taking the risk
I have a fairly simple, though expensive, task that I need to run in
I have a task that I need to perform for a friend as a
I need to perform multiple operations on an Image, for example, I need 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.