core-location

iOS Not the typical background location tracking timer issue

会有一股神秘感。 提交于 2019-11-30 07:54:24
问题 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"

Simulating location updates on the iPhone Simulator

只谈情不闲聊 提交于 2019-11-30 06:44:10
问题 I want to allow users to set the GPS information on the iPhone Simulator via GUI. But I'm not sure how to archieve this - it seems that this tool called iSimulate does this somehow by installing an own SDK. But I can't figure out how they "override" / "hack" the simulator by that. Thanks! 回答1: As far as I know, iSimulate is not employing any hacks. It is code that runs within your app on the Simulator which communicates with a device over the network. When it receives messages from the device

Beacon Ranging in Background on iOS

随声附和 提交于 2019-11-30 06:30:05
问题 I understand the difference between monitoring and ranging, and I understand the limitation of iOS in that beacon ranging can only happen in the foreground or in the background when entering and exiting regions as explained here (http://developer.radiusnetworks.com/2013/11/13/ibeacon-monitoring-in-the-background-and-foreground.html). But I'm trying to figure out how to solve a common scenario. If I had a bunch of beacons installed in a department store, how am I supposed to detect when a

Measuring velocity via iPhone SDK

折月煮酒 提交于 2019-11-30 06:16:12
问题 I need to implement a native iPhone app to measure the velocity of the phone (basically a speedometer). I know that you can do so via the CoreLocation API fairly easily, but I am concerned about battery consumption since this is to be a real-time measurement that could be used for up to a couple of hours at a time. My understanding is that while you are actively monitoring for events from the LocationManager (even though I don't actually care about GPS location) it is battery-intensive. The

Geofencing iOS 6

↘锁芯ラ 提交于 2019-11-30 05:31:30
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 code where I register the region: - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [self

Getting Longitude/Latitude of the User When the viewDidLoad

蓝咒 提交于 2019-11-30 05:03:39
My purpose is to get the longitude/latitude of the user when the view is loaded and to store the values in two variables for later calculations. I don't need to track the user location and to update it, I simply need to get his/her coordinates once . My code looks like this: - (void)viewDidLoad { [super viewDidLoad]; // locationManager update as location locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = kCLDistanceFilterNone; [locationManager startUpdatingLocation];

Send location updates every 30 minutes in Swift

女生的网名这么多〃 提交于 2019-11-30 04:56:47
I have background mode on for location services and aiming to send out location (latitude and longitude) to the server every 30 minutes. For now I am printing the same in the console. It seems to work for a while but I am wondering how do I work with NSTimer in this case. And from where should I be calling it? import UIKit import CoreLocation @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate { var window: UIWindow? var locationManager = CLLocationManager() func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:

UIBackgroundModes location and significant location changes with region monitoring

浪尽此生 提交于 2019-11-30 01:56:47
I have an app that uses a combination of startMonitoringForRegion: and startMonitoringSignificantLocationChanges to keep aware of where the user is when the app is in the background. Does this mean that I need to include the location value for the UIBackgroundModes key in the Info.plist ? This is a quote from the docs: The significant-change location service is highly recommended for apps that do not need high-precision location data. With this service, location updates are generated only when the user’s location changes significantly; thus, it is ideal for social apps or apps that provide the

Core Location delegate methods not getting called in iOS 8.3 Xcode 6.3.1

ぃ、小莉子 提交于 2019-11-30 01:48:04
问题 I am trying to get the user's current location using the Core Location Framework in Xcode 6.3.1, I did following things: Added Core Location Framework under Target -> General -> Linked Frameworks & Libraries My ViewController.h file is as shown below, #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface ViewController : UIViewController<CLLocationManagerDelegate> @property (weak, nonatomic) IBOutlet UILabel *lblLatitude; @property (weak, nonatomic) IBOutlet UILabel

iOS8: Blue bar “is Using Your Location” appears shortly after exiting app

ε祈祈猫儿з 提交于 2019-11-30 01:17:45
I would like to get the blue bar when tracking in the background, but not when not. My app uses location services all the time when active, so in iOS8 I use the requestWhenInUseAuthorization on CLLocationManager . Normally, the app stops tracking your location when you close it, but the user can choose the option to let the app track his location in the background as well. Therefore, I have the location option for UIBackgroundModes in the Info.plist file. That works perfectly: when switching to the background, the app keeps getting location updates, and a blue bar appears as a reminder that