core-location

Is it possible to run a task periodically in Background - iOS 4

非 Y 不嫁゛ 提交于 2019-12-03 23:30:08
问题 I want to poll the location from GPS in the background. So we used a NSTimer and performed periodic checks in the timer tick. In other words, can we schedule NSTimer while the app is in Background? Thanks in advance 回答1: You can't periodically execute arbitrary code, but you can get pinged on significant location changes via startMonitoringSignificantLocationChanges in CLLocationManager. 来源: https://stackoverflow.com/questions/3574248/is-it-possible-to-run-a-task-periodically-in-background

How do startMonitoringSignificantLocationChanges and startUpdatingLocation effect one-another?

a 夏天 提交于 2019-12-03 23:07:40
What happens if I call startUpdatingLocation while startMonitoringSignificantLocationChanges is running? Does significantLocationChange monitoring get stopped? If I then stopUpdatingLocation will significantLocationChange monitoring continue or restart? I can find no documentation covering the interplay between these two ways of monitoring location. They are not meant to be used concurrently. It's either or as they both deliver heading and location changes to the same delegate method. locationManager:didUpdateToLocation:fromLocation They differ in the frequency and accuracy (and by extension

iOS 6 Map problems with MKUserTrackingModeFollowWithHeading

放肆的年华 提交于 2019-12-03 20:21:39
I'm trying to solve two problems with MKUserTrackingModeFollowWithHeading in iOS 6: MKUserTrackingModeFollowWithHeading works briefly, but it's jittery and returns to MKUserTrackingModeFollow almost immediately, especially at high zoom levels. The app occasionally crashes when repeatedly changing the MKUserTrackingMode : I get EXC_BAD_ACCESS on the main thread, without further information. This is hard to reproduce, but it has happened repeatedly. Any thoughts on what might be causing this? It feels like a bug, but Apple's own "Maps" app doesn't exhibit this behavior. In order to isolate the

iOS 6 CoreLocation does not work

醉酒当歌 提交于 2019-12-03 20:16:25
I make a location app. But Core Location does not work. I tested other iPhone application on my iPhone. Like google earth, a navigation software. The other applications do not work also. Why doesn't update location? Why 'locationManager:didUpdateToLocation:fromLocation:' message called 2 times only? Maybe... My iPhone broken down? or iOS 6 CoreLocation frameworks have some bug? Location service - On on iPhone settings Info.plist armv7 accelerometer location-services gps microphone magnetometer Code Example: - (CLLocationManager *)setupLocationManager { if ([CLLocationManager

iOS: Can I manually associate wifi network with geographic location?

十年热恋 提交于 2019-12-03 16:53:34
Is it possible to make the phone to "know" that a specific wifi network is at specific geographic location? if (answer == YES) { than how? } else { can the phone figure this out by himself? } Another similar question: is there any way to start monitor a region with accuracy of ~100m but telling the CLLocationManager to use only by wifi networks and cellular antenas? Because I don't want to power up the GPS no matter what... Thanks! iPhone positioning sucks and there is nothing you can do. If you jailbreak your device you can use the Apple80211 private framework to look up the available Wi-Fi

iOS re-check location on load from background

倖福魔咒の 提交于 2019-12-03 16:35:05
I'm building an app which displays result data based on your current location. At the moment, I'm using the viewDidLoad method of a UIViewController to start the CLLocationManager and getting the current location. Once I have the location that matches the accuracy I desire, I do a request to my web service to get the results and dump it into a UITableView . My problem is that when you close the app (although it's still running in the background). If you were to drive to another town, re-open the app, the data doesn't get updated and continues to show the results from your old location.

-[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] error

穿精又带淫゛_ 提交于 2019-12-03 11:12:33
This is my code, showing both the alert and the blue dot for the current position on the map: MapName.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @interface MapName : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> @property (strong, nonatomic) IBOutlet MKMapView *MapName; @property (strong, nonatomic) CLLocationManager *locationManager; @end MapName.m - (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[CLLocationManager alloc]init]; self.locationManager.delegate = self; if ([self.locationManager respondsToSelector:

CoreLocation kCLErrorDomain error 5

余生长醉 提交于 2019-12-03 09:45:21
问题 I subclassed a CLRegion to support Polygons via overriding containsCoordinate: to use ray casting logic instead of the original distance crunching logic. The subclass is initialized via the normal method ( initCircularRegionWithCenter:radius:identifier: ), then CLLocationCoordinate2d s are added as NSValue s to a mutable array. These coordinates are used during the ray casting logic. As soon as I try to use the CLRegion subclass, I am confronted with a ton of errors in my application logic,

handling location permissions instantaneously in swift

懵懂的女人 提交于 2019-12-03 08:52:27
问题 I am trying to implement a basic map view and add a user's current location to the map as an annotation. I have added the requestwheninuse key to my info.plist and imported coreLocation. In my view controller's did load method, I have the following: locManager.requestWhenInUseAuthorization() var currentLocation : CLLocation if(CLLocationManager.authorizationStatus() == CLAuthorizationStatus.AuthorizedWhenInUse){ currentLocation = locManager.location println("currentLocation is \

IBeacon region monitoring not work consistently across devices

时光总嘲笑我的痴心妄想 提交于 2019-12-03 08:02:00
When testing with a simple app to test beacon region monitoring I seem to get very inconsistent results depending on the device (not the device model, the specific device). The problem is that I don't receive the CLRegionStateInside state on the region after requestStateForRegion and didEnterRegion does not get called at all on these device. startRangingBeaconsinRegion : works fine but to conserve power and processing it is recommended to only start ranging when the didEnterRegion : method gets called. I tested this on 6 devices and it works on half on them (iPhone 5's) and does't work on one