core-location

MyApp “has active assertions beyond permitted time” crash - CoreLocationRegistration and CoreLocationBackgroundClient

偶尔善良 提交于 2019-11-29 10:18:19
Does anyone have any insight on why this crash log is happening? The app records the locations where the user goes. So it has the UIBackgroundModes's Location is set in Info.plist to continue getting location updates in background. According to the log, something seems to crash after 10 minutes. Incident Identifier: 4BA294E8-0DDF-4EC2-812A-20394F758A7F CrashReporter Key: 59997a4e160853691bc673802439c8c4b9ca7ba3 Hardware Model: iPhone3,1 Process: MyMapApp [1234] Path: /var/mobile/Applications/826E35FE-F6B7-477E-943E-CE18D0D03145/MyMapApp.app/MyMapApp Identifier: MyMapApp Version: ??? (???) Code

CLLocation returning negative speed

北城以北 提交于 2019-11-29 09:28:56
I'm starting a new app which uses the coreLocation and the mapkit frameworks. My problem is trying to get the current speed always returns me a negative value, i have take my iPhone with me to places with a good 3g signal and it doesn't matter, location.speed value is always -1. here is the code which matters: #define kRequiredAccuracy 1500.0 //meters #define kMaxAge 60.0 //seconds in the init method: self.locationManager=[[CLLocationManager alloc] init]; self.locationManager.delegate=self; self.locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters; then didUpdateToLocation: -

Core Location in iPhone Simulator 3.2 (iPad)

我们两清 提交于 2019-11-29 07:20:54
So, i'm trying to port my app to iPad. I'm using CoreLocation. Apple says the iPad does have Location: Wi-Fi Digital compass Assisted GPS (Wi-Fi + 3G model) Cellular (Wi-Fi + 3G model) so it should be possible to get the position of my ipad (at least with 3g model) about 3km radius would be enought. but it doesnt work in simulator (3.2 ipad) (running 3.1.3 in simulator simulates me cupertino). is there a way to get the position in simulator (3.2 ipad) ? i live in germany and here the ipad isnt released yet, so i cannot test it on my device. thanks! edit thats how i'm trying to get my

iOS app doesn't ask for location permission

廉价感情. 提交于 2019-11-29 06:39:22
My Swift-iOS app is meant to show the user's location on a map. However, the XCode debug console tells me I need to ask permission to show the user's location. I think, I do that but the dialog never comes up. Here is the error message, and below the ViewController where I call CLLocationManager::requestWhenInUseAuthorization() Error: 2014-06-30 21:25:13.927 RowingTracker2[17642:1608253] Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.

Determining Midpoint Between 2 Coordinates

折月煮酒 提交于 2019-11-29 06:24:18
问题 I am trying to determine the midpoint between two locations in an MKMapView . I am following the method outlined here (and here) and rewrote it in Objective-C, but the map is being centered somewhere northeast of Baffin Island, which is no where near the two points. My method based on the java method linked above: +(CLLocationCoordinate2D)findCenterPoint:(CLLocationCoordinate2D)_lo1 :(CLLocationCoordinate2D)_loc2 { CLLocationCoordinate2D center; double lon1 = _lo1.longitude * M_PI / 180;

How to measure the distance in meters between two CLLocations?

一笑奈何 提交于 2019-11-29 05:37:34
How can I get the distance in meters between two CLLocation s? CLLocation doesn't provide any method to do it, it seeems. CLLocationDistance distance = [aCLLocationA distanceFromLocation:aCLLocationB]; // distance is a double representing the distance in meters CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation]; // distance is expressed in meters CLLocationDistance kilometers = distance / 1000.0; // or you can also use this.. CLLocationDistance meters = distance; NSString *distanceString = [[NSString alloc] initWithFormat: @"%f", kilometers]; flot

iOS Not the typical background location tracking timer issue

断了今生、忘了曾经 提交于 2019-11-29 05:23:29
i'm developing a sample app that tracks the user's position in background, but i don't want to leave the location service always enabled, but something in my timer does not behave properly. My idea was that every x minutes, the service goes on, and when it have a correct new location it is released again, now is set to 10 seconds just for testing. (Significant LocationChange did not the trick, not accurated enough) I was searching a lot (iOS Dev center + StackOverflow) and found the "new" background location features, that allows you to run code over 10 minutes after going to background, using

CLLocationManager didEnterRegion: with iBeacon while app is suspended

 ̄綄美尐妖づ 提交于 2019-11-29 05:11:43
I'm trying to wake up my app (relaunch it) when it enters my defined beacon region but I just can't get it to work. This are the steps and code I'm using. Set "Location updates" Background Mode to YES. Monitor my CLBeaconRegion NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"EBEFD083-70A2-47C8-9837-E7B5634DF524"]; beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"daRegion"]; beaconRegion.notifyEntryStateOnDisplay = NO; beaconRegion.notifyOnEntry = YES; beaconRegion.notifyOnExit = YES; self.locationManager = [[CLLocationManager alloc] init]; self.locationManager

significant location change does not trigger on device

无人久伴 提交于 2019-11-29 04:26:25
I am using significant location change monitoring. When I run the code in the simulator and check Freeway option I get periodic location updates. I grab these updates and save them in NSUserDefaults and than update tableview every 10s, so I can see if I got any updates. If I run the app on a real device, I get zero updates. I kept the phone in my pocket and travelled over 80km, been in 2 cities. Zero updates. Not sure if I messed something up. I am attaching the code. The code is copy paste, feel free to test. Just make sure to use TableViewController in storyboard and set cell id to ID. What

Geofencing iOS 6

孤人 提交于 2019-11-29 04:15:03
问题 I am creating an app that tells the user whether they are near the destination. I am calculating the distance between the currentLocation and the destination. I'm doing the calculation inside the didUpdateLocations . It is working but I've seen that there are methods that can deal with that without the need of doing any math. I am registering the region in the CLLocationManager ; however it seems that the methods didExitRegion and didEnterRegion are not been called. Here are the part of the