Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do I get a background location update every n minutes or every 1 hours in my iOS application

Posted on 2012-09-21
11
Medium Priority
?
2,295 Views
Last Modified: 2012-11-21
hello,

- We will start the GPS with configuration to get Accurate location.
- Get the user's current location every 1 hour with best accuracy.
- To update Longitude and latitude every 1 hours

Main feature is when we stop my application then application is running on background whenever any client get information about the person.

How to track location when my application stop? but it is running on background service..

Please give me example of this solutions so i can give demo to client

Thanking you...
0
Comment
Question by:citadelind
  • 6
  • 5
11 Comments
 
LVL 15

Assisted Solution

by:Hamidreza Vakilian
Hamidreza Vakilian earned 1500 total points
ID: 38423570
Just enable background location services on your Xcode project:
Info.plist > Required background modes > App registers for location updates

Then the location manager delegate call back:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

Open in new window

will be called whenever the user position is changed whilst your app is in background.

Also a good tutorial for core location service:
http://mobileorchard.com/hello-there-a-corelocation-tutorial/
0
 

Author Comment

by:citadelind
ID: 38424747
But My application is closed then how to get longitude and latitude in background??

Is this possible??

My application is closed then also get longitude and latitude of my iphone??

Give me solutions
0
 
LVL 15

Assisted Solution

by:Hamidreza Vakilian
Hamidreza Vakilian earned 1500 total points
ID: 38424765
Yes; if you enable the background location service on your plist file your app will receive location updates even in backround.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:citadelind
ID: 38424774
how to change plist file in my application?

Please give me example so we can much clear.

My question is: if my iphone is restart then application still running on my iphone and get longitude and latitude in background?

Is it possible??

If yes then give me example how?

Thank you..
0
 
LVL 15

Assisted Solution

by:Hamidreza Vakilian
Hamidreza Vakilian earned 1500 total points
ID: 38424804
No; if the phone gets restarted your application won't get any location updates anymore. Then the user must open your app at least once and if he presses the home button your app will continue working in background mode.
Please notice that iOS does not support start-up applications.
0
 

Author Comment

by:citadelind
ID: 38427631
As Per your suggestion,

We enable "Application is Background only" in plist. But still my application is closed then background process is stop.

Please give me proper solutions and example so we can move ahead...
0
 
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38427644
If you press the home button your app will go into background; does it receive loation updates?
(if you close the app by double pressing te home button and removing it's icon from the bottom section it will be terminated thus no location updates)
0
 

Author Comment

by:citadelind
ID: 38427659
If you press the home button your app will go into background; does it receive loation updates?

Yes it will...... But

(if you close the app by double pressing te home button and removing it's icon from the bottom section it will be terminated thus no location updates)

Not getting as per this.....

But we want to removing icon from bottom section then also it will be getting location?

how to do this??

Thanking you..
0
 
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38429658
It is not possible in iOS unfortunately.
iOS does not support backgrounding like that. Actually backrounding in iOS is so poor. It lacks strong backgrounding capabilities.
0
 

Accepted Solution

by:
citadelind earned 0 total points
ID: 38431344
ok thank you

One more problem is:

If you press the home button your app will go into background;

We want to store location based on press the home button and app will go into background but it is continue updating into database still not removing it's icon from the bottom section.

How to do this? can you give me example how it works?

We tried "Multitasking" in iphone, but it is not stored in database. why it so i do not know...

we are using web service to store all data into Microsoft SQL server.

Please give me example how to store?

Thanking you...
0
 

Author Closing Comment

by:citadelind
ID: 38620115
Good
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question