So I am using parse to get an update of the users location and data from that query like so:
-(void) getUserLocationAndData:(BOOL) showProgress
{
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error)
{
if (!error)
{
NSLog(@"Got current location - Zooming Map!");
CLLocationCoordinate2D zoomLocation;
zoomLocation.latitude = geoPoint.latitude;
zoomLocation.longitude = geoPoint.longitude;
[self getNearByData:geoPoint];
}
else
{
[[[UIAlertView alloc] initWithTitle:@"Unable to get Current Location" message:@"This app needs your current location in order to locate near by data. Please check your internet connection and make sure you enabled access to the location information." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil] show];
}
}];
}
When the app first launches the user location shows up, the data is pulled and everything works. If you wait about 15 seconds and don't move the user location icon turns gray (see image) and any updates result in a failure. If I reload the view it works again but the same thing happens.
I am not using a CLLocationManager because I do not need to constantly pull the data near the user. Just every so often or on demand by the user.
I have also noticed if I wait long enough the user location goes Blue again and all seems to work. What is causing this timeout? Can I set this timeout, or do I need to just use a CLLocationManager to have any control of this? Is Parse just timing out with an internal CLLocationManager or something?
Thanks for the help!