core-location

Getting user's current location iOS 8.0

夙愿已清 提交于 2019-12-02 07:31:48
I trying to get users current location using MapKit and CoreLocation. I'm really new to Objective-C. As for my research the implementation is slightly different from older iOS to iOS 8.0. I have followed everything correctly. Still it is getting current location. My actual target is to get pin user location on the mapKit during run time when the user gives the location in the text field. filename.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface LocationSelectionViewController : UIViewController <CLLocationManagerDelegate> @property (weak, nonatomic) IBOutlet UITextField

Location manager didUpdateLocations not being called

对着背影说爱祢 提交于 2019-12-02 05:46:00
For some reason didUpdateLocations is not being called, even when I set the delegate to the view controller. In info.plist I set the key Privacy - Location When In Use Usage Description to a description. So I'm not sure what I could be doing wrong? import MapKit import CoreLocation class OptionsViewController: UIViewController, UITableViewDelegate, CLLocationManagerDelegate { override func viewDidLoad() { //Ask user for location locationManager = CLLocationManager() locationManager.requestWhenInUseAuthorization() //Use users current location if no starting point set if CLLocationManager

iBeacon ranging in the background?

ぃ、小莉子 提交于 2019-12-01 23:32:49
问题 I have started to test out iBeacons using estimotes as beacons. It's all running pretty good, but i'm struggling with getting the app to run properly in the background. self.region = [[CLBeaconRegion alloc] initWithProximityUUID:self.uuid identifier: self.deviceID]; self.region.notifyEntryStateOnDisplay = YES; [self.locationManager startMonitoringForRegion:self.region]; So this is the basic setup and for my test app i want to show a local notification when my phone is in immediate proximity

iBeacon ranging in the background?

青春壹個敷衍的年華 提交于 2019-12-01 22:13:05
I have started to test out iBeacons using estimotes as beacons. It's all running pretty good, but i'm struggling with getting the app to run properly in the background. self.region = [[CLBeaconRegion alloc] initWithProximityUUID:self.uuid identifier: self.deviceID]; self.region.notifyEntryStateOnDisplay = YES; [self.locationManager startMonitoringForRegion:self.region]; So this is the basic setup and for my test app i want to show a local notification when my phone is in immediate proximity of the beacon. My problem is that it won't work unless i include the line below. [self.locationManager

SignificantLocationChanges doesn't work since iOS 8

我怕爱的太早我们不能终老 提交于 2019-12-01 21:28:05
I have a problem with the SignificantLocationChanges since the release of iOS 8. The method [locationManager startMonitoringSignificantLocationChanges]; is called correctly after checking for availability, the delegates also work nice (I check it with the didChangeAuthorizationStatus method, which is part of the same delegate and object) and compiler has no doubts, but there comes absolutely no updates and no errors from the didFailWithError method. The log says the authorizationStatus is 4, which is ok I think. Before iOS 8 this all works fine. The first test-device (iPad 2 with 3G) runs iOS

CLLocationManager requestWhenInUseAuthorization() not working

独自空忆成欢 提交于 2019-12-01 18:52:57
I am trying to use location services in my iOS app but for some reason requestWhenInUseAuthorization is not working. When the user first uses the app, the prompt comes up as normal asking for permissions but then when you open the app a second time, for some reason didChangeAuthorizationStatus method is not called so I cannot display the user current location on the map. My code is below: override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib locationManager.delegate = self locationManager.requestWhenInUseAuthorization() var

iOS detect mock locations

点点圈 提交于 2019-12-01 17:33:28
Currently I'm working on an App which geolocation capabilities are its most important feature. Actually we're very concerned about getting GPS values mocked up. I've read a lot of comments regarding mocking locations on both iOS and Android and most of them tend to explain an unjailbroken iOS device can't mock locations, but the truth is I've created another project, with a GPX file to mock up location on that project and when executed, the entire system believes I'm in another city. All my locationManager callbacks tell me I'm on the mocked location with the proper timestamp, faking the

CLGeocoder geocoding is hopelessly inaccurate

你离开我真会死。 提交于 2019-12-01 15:04:22
I have an App that does forward geocoding (get coordinates given address) to display a bunch of pins on an MKMapView . The app was developed well before iOS supported forward geocoding using CLGeocoder (first available in iOS 5). As such my app uses the Google Maps Geocoding API , which is generally very accurate. Given a full address with a street number it will generally give you the exact location of that address within a couple of metres. I'm doing some updates to my App to support iOS 6 and decided to switch from using the Google API to using CLGeocoder provided the app was running on iOS

How to calculate elevation like in runkeeper application

Deadly 提交于 2019-12-01 13:04:41
问题 I have application that track user movement. And I store all relevant data lat/lng/alt etc. I am trying add elevation like on runkeeper just without graphic I need just to get elevation value. In my .h file: @property (nonatomic) double netElevationLoss; @property (nonatomic) double netElevationGain; @property (nonatomic) double netElevationChange; In my .m file: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *

Send Location of User in Background Swift

折月煮酒 提交于 2019-12-01 12:39:10
I am building an app where the user clicks a button and for 60mins (or any amount of time) we keep track of them by uploading their location to a server. Currently we are using 'Did Update Locations' function to send the users location to firebase in real-time. func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { } This system works but it spams the server sending the location of the user to the server once every second. This is too much data and we would only need to send the users location to the server once every 10-30 seconds. What can we do send