core-location

didExitRegion not fired when turn off bluetooth

人走茶凉 提交于 2019-12-10 13:51:53
问题 Im building a simple ios app with IBeacon , I'm monitoring a region but I have some issues with enter and exit events. If I go into a region the callback didEnterRegion is fired, but being within the region, turning off bluetooth doesn't fire didExitRegion callback. Is this the expected behavior? This is an issue since I have to be able to detect when the user exits the region. Any idea? Thanks 回答1: For testing purposes you must turn off your beacons or move out of range to get a

Location Access Request in iOS 11

北城以北 提交于 2019-12-10 12:50:05
问题 I am requesting the user location in my app. locationManager.requestAlwaysAuthorization() This line of code should return this alert message: However, I want the user to choose between "Don't Allow" and "Always Allow" only. how can I delete the "Only While Using The App" option? Knowing that this is what I included in the info.plist, and deleting any row from these 3 rows in the info.plist is causing the app not to show this alert at all. 回答1: It is not optional anymore. Since iOS 11 has been

What is initWithCoder actually doing when used in conjunction with a core location manager object?

本小妞迷上赌 提交于 2019-12-10 12:23:00
问题 Ok so I'd like to full understand what is going on in this piece of code with initWithCoder. Here's what I think is going on after reading through several suggested docs and reading chapters from a book on delegation, core location, designated initializers over and over again. Initialize my viewcontroler with a pointer to an NSCoder object. If that works then create an instance of a location manager object Make the delegate my viewcontroller. Set location accuracy to best. Tell the location

iOS Region Monitoring not working

寵の児 提交于 2019-12-10 11:34:00
问题 I have been doing some iOS development for a couple of months and recently I am developing a bus app. I am currently mimicking the bus' movements and set up multiple annotations on the bus stops. For test purposes, I have setup just one bus stop and am trying to monitor when the bus has entered this region and exited as well. Strangely, my didStartMonitoringForRegion method is called perfectly but neither the didEnterRegion nor didExitRegion methods are called. Every time I run the program,

Is geofence accuracy dependent on locationManager’s accuracy or distance filter?

倖福魔咒の 提交于 2019-12-10 10:44:11
问题 Is geofence accuracy dependent on locationManager’s accuracy or distance filter? Or they are independent of each other because geofence is managed by the OS and uses Wifi/Cell tower info? For example: locationManager locationManager.distanceFilter = 1250; locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; region let title = "Lorrenzillo's" let coordinate = CLLocationCoordinate2DMake(37.703026, -121.759735) let regionRadius = 550.0 let region = CLCircularRegion(center:

iOS Force geolocation to return city name in a specific language

风格不统一 提交于 2019-12-10 10:35:57
问题 I've encountered a rather strange situation where the backend developer asked me to force the city name that is returned from performing a geolocation to be in a specific language? For instance have it return København instead of Copenhagen no matter what language the iOS is to. I couldn't find anything on the web regarding this. Your help will be much appreciated. Thanks 回答1: Not sure if this is the best and safest solution but you could temporarily change the locale while you make the

iOS Location update even app is not running (like find my iphone)

末鹿安然 提交于 2019-12-10 09:51:41
问题 I want to write location tracking app like " find my iphone " that runs in foreground,background and even terminating ( not running) . Location will be sent to my server periodically time. I have searched in google and read many many documents,tutorials comments, codes about this topic. Then I have found this tutorial. But in this tutorial, location is sent to ".txt" file in foreground and background not terminating ... I mean, when the app is killed, it is not relaunched in the background to

Disabling allowsBackgroundLocationUpdates (CLLocationManager) doesn't work after is was enabled

天大地大妈咪最大 提交于 2019-12-10 09:25:43
问题 My Application works with continuous background location updates. Of course it has all the permissions and other stuff like allowsBackgroundLocationUpdates = true Initially I wanted to react to LowPowerMode changes while in background using NSProcessInfoPowerStateDidChange notification. And to disable allowsBackgroundLocationUpdates to stop updating locations without calling stopUpdatingLocation . However, I found out that after receiving the notification and setting

How to set the location in the iOS simulator without writing code?

半城伤御伤魂 提交于 2019-12-10 03:59:55
问题 My problem was how to set the gps location of my app when running in the iOS simulator The home screen in my app displays sunrise and sunset times based on gps location and I wanted a screen shot with sensible values - I'm in the UK and the sunrise times were showing UK times for American sunrise and sunset. As it is on the launch screen one solution, going to Debug -> Simulate Location, is too late for me. Took me a while to work out and I wasn't finding the answer when I searched here

iPhone Core Location: Calculate total elevation loss/gain

时光怂恿深爱的人放手 提交于 2019-12-09 21:05:04
问题 I am wanting to calculate total elevation loss and gain at the end of recording Core Location data. I am having a hard time thinking of the math for this one. Say if I started at 600 feet and I go up and down during the tracking, how would I calculate my elevation gain and loss? Ideas? 回答1: If you wanted to track gain and loss separately, keep two cumulative member variables, netElevationLoss and netElevationGain, both initialized to 0. - (void)locationManager:(CLLocationManager *)manager