ios,objective-c,cllocationmanager
You need to set the desiredAccuracy, distanceFilter, headingFilter(if you need it) properly, where you have initialised locationmanager. /* Pinpoint our location with the following accuracy: * * kCLLocationAccuracyBestForNavigation highest + sensor data * kCLLocationAccuracyBest highest * kCLLocationAccuracyNearestTenMeters 10 meters * kCLLocationAccuracyHundredMeters 100 meters * kCLLocationAccuracyKilometer 1000 meters * kCLLocationAccuracyThreeKilometers 3000...
ios,oop,swift,delegates,cllocationmanager
These delegate methods, defined in the CLLocationManagerDelegate protocol, are called by the CLLocationManager object that you instantiated and are referencing in the manager variable. So, you've instantiated the CLLocationManager object, you've asked it to inform you when there are location updates, and it does that by calling these delegate methods...
ios,geolocation,cllocationmanager,ibeacon,clbeaconregion
a CLBeaconRegion represents N bluetooth beacons with the same uuid. an ibeacon has no gps coordinate. it has an RSSI value (the signal strength) and a 'calculated' proximity property but no location. same as a wifi router ;) there are services to associate beacons/wifi routers with a GPS location but...
ios,singleton,cllocationmanager,locationmanager,geofencing
GeoFenceController will use a global resource - the pool of 20 regions available to your app. That pool is implemented in such a way, that not only a capacity is shared among all the instances of CLLocationManager, all the regions will be effectively shared as well, as all instances of...
The location manager may send you several updates as it improves its accuracy. This is a feature designed to give you information it as as quickly as possible, while eventually getting the best information to you (at least up to the accuracy you requested). You are actively avoiding those updates,...
Please find below code for getting location on background mode - Please enter text for NSLocationAlwaysUsageDescription in plist file . Please select location updates on background mode from project settings - AppDelegate.h // // AppDelegate.h // LocationTest // // Created by Santu C on 28/05/15. // Copyright (c) 2015 company....
When you pause the location updates, the system considers that you don't need the location for now. Resuming it will only give you the current location. This is a normal behavior.
Go in settings > Privacy > Location services > Your app > Always. You can also check other alternatives posted in the following question Core Location not working in iOS 8...
objective-c,xcode,localization,parse.com,cllocationmanager
you have: if (distance < smallestDistance) { distance = smallestDistance; closestLocation = location; which assigns smallestDistance which is initialized to DBL_MAX to distance so smallestDistance will never change. What you need: if (distance < smallestDistance) { smallestDistance = distance; closestLocation = location; Which updates smallestDistance to distance when distance is...
ios,objective-c,mapkit,cllocationmanager,location-services
On iOS 8, they changed how you ask for location permission. Instead of just being able to call startUpdatingLocation you need to now call either requestWhenInUseAuthorization or requestAlwaysAuthorization.
I've made this two function to check for each case If user explicitly denied authorization for your app only you can check it like this, + (BOOL) isLocationDisableForMyAppOnly { if([CLLocationManager locationServicesEnabled] && [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) { return YES; } return NO; } If location services are disabled in Settings,...
ios,objective-c,cllocationmanager
Here is the best way to use Location manager in multiple view controllers: in AppDelegate.h @interface AppDelegate : UIResponder <UIApplicationDelegate, CLLocationManagerDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) CLLocationManager * locationManager; @property (nonatomic, strong) CLLocation *currentLocation; in AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions if([CLLocationManager locationServicesEnabled]){...
Delegates normally are weak so there is no object retaining your delegate and that's the cause of your Bad memory access error. You should do something similar to this: class ViewController: UIViewController { let locationManager = CLLocationManager() //instantiate and hold a strong reference to the Core Location Manager Delegate //Normally...
ios,objective-c,cllocationmanager,cllocation
Lots of useful comparisons here: http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/ Also, silly question time: you mix _location and self.location but you don't show your property/synthesize code. Are you sure you're operating on the same object?...
ios,google-maps,swift,cllocationmanager
To solve this issue call the deferredLocationUpdatesAvailable class method of the CLLocationManager class to determine whether the device supports deferred location updates. Call the allowDeferredLocationUpdatesUntilTraveled:timeout: method ofthe CLLocationManager class to begin deferring location updates. To prevent itself from calling the allowDeferredLocationUpdatesUntilTraveled:timeout: method multiple times, the delegate uses an internal property...
Apple won't display your alert if the user has already pressed Don't Allow. On the other hand, you can check the authorization status and show a pop telling the user to go to settings and changing it manually. CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (status == kCLAuthorizationStatusNotDetermined) { // Show...
Yes It is possible. You can extend the awaken time by using the beginBackgroundTaskWithExpirationHandler: method of UIApplication class....
make sure, you follow the guidelines in the Documentation https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html especially that the ´UIRequiredDeviceCapabilities´ key is in your Info.plist....
ios,swift,mapkit,cllocationmanager
if you were to choose "No" when it requests, I want to be able to then turn it back on again Once the user has chosen to refuse you authorization, you cannot magically contradict the user, and (alas) you cannot make the system's authorization dialog appear ever again. The...
ios,swift,core-location,cllocationmanager
the didFailWithError or didChangeAuthorizationStatus methods are not being called Those are delegate methods. Your location manager does not have any delegate - certainly it does not have you (the AwesomeViewController instance) as a delegate. So it is not going to call those methods, ever. You need to set the...
ios,swift,cllocationmanager,reverse-geocoding
you never reverse geocode the location but you pass in manager.location. see: CLGeocoder().reverseGeocodeLocation(manager.location, ... I assume that was a copy&paste mistake and that this is the issue - the code itself looks good - almost ;) working code var longitude :CLLocationDegrees = -122.0312186 var latitude :CLLocationDegrees = 37.33233141 var location...
ios,objective-c,iphone,gps,cllocationmanager
Getting your position drains power, you can do few things to avoid that: use significant location changes (it is good if you do not need precise locations per time) limit the accuracy (changing this can make you avoid the use of GPS that it is really a battery drainer) I'm...
ios,objective-c,location,cllocationmanager
Your values are nil because the location manager never sends you updates. There's new functions you need to call in iOS 8 to get the location manager to work. See this post as a starting point: http://stackoverflow.com/a/24063578/78496
ios8,location,cllocationmanager,theos,springboard
It's all due to iOS 8 changes. On previous iOS versions at least locationd had com.apple.locationd.preauthorized entitlement which gives access to location without user permission. Now even locationd doesn't have it. Same with SpringBoard and imagent. Of course, being locationd it can access location through it's own APIs - locationd...
ios,background,cllocationmanager
It looks like you're using CLLocationManagerDelegate's deprecated function: -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { } Instead you should implement - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { } ...
ios,location,mkmapview,cllocationmanager,mkmapitem
For an MKMapView object to be showing user location you will have to have requested authorisation for iOS8 (ie using requestWhenInUseAuthorization on a CLLocationManager object). MKMapView objects have a didUpdateUserLocation: delegate method you could use receive user location updates, but this may fire off repeatedly until it reaches the accuracy...
ios,objective-c,location,static-libraries,cllocationmanager
i hope its helps you. Call [locationManager requestWhenInUseAuthorization] inside if()..... if ([CLLocationManager locationServicesEnabled]) { locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = kCLDistanceFilterNone; if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { [locationManager requestWhenInUseAuthorization]; } [locationManager startUpdatingLocation]; } else{ UIAlertView...
ios,objective-c,parse.com,cllocationmanager
You need to explicitly create the CLLocation instance using initWithLatitude:longitude: with the latitude and longitude from the PFGeoPoint. There is only a convenience method for creating a PFGeoPoint from a CLLocation, not the other way round.
ios,objective-c,cllocationmanager
For background location updates your app may not be running at the time the update is generated. If you've been terminated then you may be re-launched as a result of the location update. In that case your app delegate is probably the best candidate for the location manager delegate. You...
In plist you have to add 2 entries NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription Make the string of both as "Location is required to find out where you are" or anything self.locationManager = [[CLLocationManager alloc]init]; if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { [self.locationManager requestWhenInUseAuthorization]; } self.locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; CLAuthorizationStatus authorizationStatus= [CLLocationManager...
Try [locationManager stopUpdatingLocation]; locationManager = nil; ...
It looks like you are ranging two different regions from a previous run of your app. Try uninstalling and reinstalling.
This happens because when your view loads it has not received any location update. Implement DidUpdateLocations and access location info there. if you need reference you can look DidUpdateLocations func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { let locationZoom = locations.last as! CLLocation let latitude: Double = locationZoom.coordinate.latitude let longitude: Double...
ios,ios8,mapkit,core-location,cllocationmanager
Your CLLocationManager instance is released by ARC after the method completed executing. As soon as the instance was released, the dialog disappeared. The solution was rather simple. Change the CLLocationManager instance from being a method-level variable to be a class-level instance variable, and make it Strong - this is for...
ios,iphone,cocoa-touch,cllocationmanager
Once configured, the location manager must be "started" for iOS 8, specific user level permission is required, "when-in-use" authorization grants access to the user's location important: be sure to include NSLocationWhenInUseUsageDescription along with its explanation string in your Info.plist or startUpdatingLocation will not work. if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { [self.locationManager requestWhenInUseAuthorization];...
ios,swift,core-location,cllocationmanager
Please check if you have enable Location in background modes from project settings -> Target -> Capabilities. ...
Are you sure you are using the return address after completion block? I have used the above code and its working fine. Here you can download the sample code CLGeocoder *geoCoder = [[CLGeocoder alloc]init]; __block NSString *returnAddress = nil; CLLocation *locloc = [[CLLocation alloc] initWithLatitude:12.92243 longitude:80.23893]; [geoCoder reverseGeocodeLocation:locloc completionHandler:^(NSArray *placemarks,...
ios,cllocationmanager,geofencing
I tried this earlier and it didn't seem to work, but then I changed the delegate of my location manager and it seems to work now in the didDeterminState method. CLLocation* location = [self.locationManager location]; NSDate* eventDate = location.timestamp; float accuracy = location.horizontalAccuracy; NSTimeInterval howRecent = [eventDate timeIntervalSinceNow]; CLLocation* regionLocation...
ios,swift,core-location,cllocationmanager,ios9
If you're using CoreLocation framework in your app in Xcode7(pre-released),and you may notice that there is a newly added property called allowsBackgroundLocationUpdates in CLLocationManager class. This new property is explained in the WWDC session "What's New in Core Location". The default value is NO if you link against iOS 9....
The error message is quite self-explained. First of all, you didn't initialized CLLocationManager in your viewDidLoad. You can initialize with (before the delegate line): self.locationManager = [[CLLocationManager alloc] init]; Then, you have to request for location service, using [self.locationManager requestWhenInUseAuthorization] or [self.locationManager requestAlwaysAuthorization]. (Not to forget to add corresponding usage...
ios,swift,mkmapview,cllocationmanager
After calling lm.startUpdatingLocation() the location manager calls didUpdateLocations() whenever it detects a location change, so you need to implement CLLocationManager::didUpdateLocations to retrieve the location: import UIKit import MapKit import CoreLocation class mapClass : UIViewController,MKMapViewDelegate,CLLocationManagerDelegate{ var location4 = CLLocation() var lm = CLLocationManager () @IBOutlet var propMapa: MKMapView! ... lm.delegate=self lm.desiredAccuracy...
ios,multithreading,swift,cllocationmanager
I don't really understand what your code is supposed to do. There's no reason for the GCD code in your viewDidLoad. simply create an instance of the location manager and tell it to start updating your location. Then your didUpdateLocations method will be called once a location is available. Use...
ios,objective-c,cllocationmanager
I have face same problem, Following are the steps I was follow and get succeed. After add your geofence Array data in location manager. Use below code for the same. for (CLRegion *monitored in [locationManagerGeofence monitoredRegions]) { [locationManagerGeofence stopMonitoringForRegion:monitored]; } self.geofencesArray = [NSMutableArray arrayWithArray:[self buildGeofenceData]]; if([CLLocationManager regionMonitoringAvailable]) { for (CLRegion...
ios,objective-c,cllocationmanager
As the documentation for didUpdateLocations says the array is ... ... An array of CLLocation objects containing the location data. This array always contains at least one object representing the current location. If updates were deferred or if multiple locations arrived before they could be delivered, the array may contain...
ios,gps,cllocationmanager,cllocation
Your coordinates aren't appearing yet when you attempt to print them in viewWillAppear: because the CLLocationManager hasn't had enough time to retrieve the first location yet. Wait until didUpdateLocations: is first called before attempting to utilize the device coordinates because didUpdateLocations: is where you'll be receiving those coordinates. I recommend...
ios,objective-c,swift,core-location,cllocationmanager
Just create a singleton location manager class (say, MyLocationManager). Your .h file can look like this: @interface MyLocationManager : NSObject <CLLocationManagerDelegate> @property (strong, nonatomic) CLLocation *currentLocation; + (id)sharedInstance; - (void)updateCurrentLocation; @end Then in the .m file implement the methods: #import "MyLocationManager.h" @interface MyLocationManager () @property (strong, nonatomic) CLLocationManager *locationManager; @end...
mapkit,core-location,cllocationmanager
In iOS 8, you can check the current permission that you get from the user. If the user gives you an Always permission, that means that they allow significant location changes. If they only allow WhenInUse, they don't allow significant location changes. See this post for details on what you...
ios,objective-c,cllocationmanager
The time interval between update calls to the location manager delegate is variable, so the behavior you're experiencing is expected. CLLocationManager has a property called location which returns the last known location of the user (or nil if you've never used the Location Manager in the app). Instead of waiting...
You can put the self.locationManager.startUpdatingLocation() inside your actionLocation() function, so that it will start getting new locations after you press a button. The distanceFilter is to specify the minimum update distance in meters. If you set the value to 500, it will only update every 500 meters you move. By...
ios,iphone,gps,settings,cllocationmanager
Yes, once the setting is "never" the user will not be prompted by iOS to provide permission - they have given an answer and it is "no". You can display an alert in your app to ask them to turn it on, but if you do this too frequently...
ios,objective-c,cllocationmanager,ibeacon
of course yes. in the CLLocationManagerDelegate you will find - locationManager:didStartMonitoringForRegion: . here you will find the full delegate description.
ios,cocoa-touch,mkmapview,mapkit,cllocationmanager
I prefer to use CLLocationManager which is used internally by the MKMapView, so if you don't need to use the map, just use the below code from the location manager. locationManager = [[CLLocationManager alloc] init]; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.delegate = self; [locationManager startUpdatingLocation]; Just don't forget to...
ios,objective-c,cllocationmanager,ibeacon
The only way to range iBeacons is to use CoreLocation, and unfortunately it is very power consuming. However, you can turn on the Ranging only when you need it. Monitoring consumes much less energy and it is enough to find out if you are in iBeacon range. I have implemented...
ios,google-maps,swift,core-location,cllocationmanager
First you need to add NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription(if you want to use in background) in your info.plist file. See the following image: Next, in your swift file, you need to call either locationManager.requestWhenInUseAuthorization() or locationManager.requestAlwaysAuthorization() in your viewDidLoad() method. Finally, you can do a mapView.camera = GMSCameraPosition(target: locations.last!.coordinate, zoom: 15,...
ios,objective-c,cllocationmanager
Add these properties in your plist file. The value of string could be anything you want. Edited to further answer another query of Mike in the comment: In your viewcontroller's .h file @interface YourViewController : UIViewController<CLLocationManagerDelegate> ...
ios,swift,core-location,cllocationmanager
What you are asking for isn't possible using CoreLocation directly. With LocationManager, if you want true north, you must call 'startUpdatingLocation` so that headings can be returned with true north values. There isn't a method to set the location manually for LocationManager to use. However you can calculate true north...
You could init the CLLocationManager before requesting authorisation, but I would also recommend against just assigning for permission right away. The link here has a good write up on the most effective way to ask for permission: http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/
ios,objective-c,cllocationmanager,ibeacon
Those docs are misleading because they are meant to cover monitoring for geofence regions (e.g. CLCircularRegion) as well as beacon regions (CLBeaconRegion). The Heuristics you describe apply only to geofences. For beacons, detection times on entering a region vary depending on the hardware. On iPhone 4S devices, beacon region entry...
objective-c,sms,xcode6,mkmapview,cllocationmanager
Now what do you mean by "send" it to the user? If you just want to send the coordinates of where you are, I would try changing your code to this: - (IBAction)send:(id)sender { MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init]; [controller setMessageComposeDelegate:self]; NSString *theLocation = [NSString stringWithFormat:@"latitude: %f longitude: %f",...
parse.com,mkmapview,cllocationmanager
Easiest way to do this is to have a column in the database named visible. You should only query for users that have it set as true. When you don't want a user to be seen, set his visible column to false.
First add this line locManager.delegate = self; override func viewDidLoad() { super.viewDidLoad() locManager.delegate = self; locManager.requestWhenInUseAuthorization() locManager.startUpdatingLocation() if(CLLocationManager.authorizationStatus() == CLAuthorizationStatus.AuthorizedWhenInUse){ var currentLocation = locManager.location longitude = currentLocation.coordinate.longitude latitude = currentLocation.coordinate.latitude textBox.text = longitude.description + latitude.description } than in your class add...
swift,cllocationmanager,latitude-longitude
If you want to access your location variable outside the CLLocationManagerDelegate method you should declare it right where your class definition starts: class MyClass { private var currentCoordinate: CLLocationCoordinate2D? } Then in your location delegate method you assign the current value: func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { currentCoordinate =...
ios,swift,cllocationmanager,cllocation
The problem is that locUtil, to which you have assigned your LocationUtil instance, is an automatic variable — that is, it is local to the viewDidLoad function. Thus, when viewDidLoad runs, locUtil (and your LocationUtil instance) comes into existence, exists for one more line, and vanishes in a puff of...
ios,ios8,gps,core-location,cllocationmanager
In iOS8 and later requestWhenInUseAuthorization puts up the blue bar. It's put up by Apple to remind the user of the device that the app is using CoreLocations. On the other hand if you use requestAlwaysAuthorization blue bar wont' show, but Apple will periodically remind users that your app is...
ios,objective-c,swift,core-location,cllocationmanager
Just use a bool as Mr H said above. func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { var lastLocation: CLLocation = locations.last! as! CLLocation var accuracy = lastLocation.horizontalAccuracy static bool flag = NO; //Or however this is done in Swift) if (accuracy < 100 && !flag) { //Check the flag in...
ios,swift,cllocationmanager,ibeacon
You can use the locationManager:didDetermineState:forRegion: callback, which tells you if you are either Inside, Outside or Unknown. You can force yourself to get a callback by calling locationManager.requestStateForRegion(region) when your app starts up. See more here: https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/#//apple_ref/occ/intfm/CLLocationManagerDelegate/locationManager:didDetermineState:forRegion:...
ios,objective-c,authorization,cllocationmanager
You have to do it like this: 1)#import <CoreLocation/CoreLocation.h> 2)Set delegate CLLocationManagerDelegate 3)Create CLLocationManager *locationManager; Object 4)#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) in your .m file 5)Setup location manager if (self.locationManager==nil) { self.locationManager = [[CLLocationManager alloc]init]; } self.locationManager.delegate = self; CLAuthorizationStatus status = [CLLocationManager...
You can differentiate them by setting major and minor parameters of beacon. You are using UUID @"E2C56DB5-DFFB-48D2-B060-D0F5A71096E0" so I can assume that you have RedBear Beacon. If so, you can download app and configure your beacon (major, minor, uuid etc.). Edit: As @Daij-Djan wrote - you can use CoreBluetooth and...
ios,swift,nstimer,cllocationmanager
You do not want to assume that the location manager will have a valid location. Nor do you want to have a while loop or a timer, waiting for it. What you want to do is start location services in viewDidLoad, request permission for location services with requestWhenInUseAuthorization or requestAlwaysAuthorization...
This is happen when your device is not able find out your location from actual GPS system , wifi or internet. My observation is that when device(it was iPhone 4 for my case) is in a close room and connected with Wifi using hotspots from Laptop then most the time...
ios,objective-c,iphone,cllocationmanager,cllocation
Yes, you can query CMMotionActivityManager from locationManager:didVisit: Please note that visits are not reported to your app in real time, in my tests they are be delayed 20 to 60 minutes. That means starting activity monitoring with startActivityUpdatesToQueue:withHandler: makes no sense, as these updates won't tell you what happened during...
Found the answer while watching the WWDC CLLocation updates to iOS 8 available here: https://developer.apple.com/videos/wwdc/2014/?id=706 Reminders and similar apps work without requiring for AlwaysAuthorization since they take advantage of the UILocalnotification framework changes. Since iOS 8, it supports Region Based Triggering. So now if you do not need to actually...
The problem is that this is not how location manager works. startUpdatingLocation() does not immediately change the state of the location manager. Instead, it calls you back in a delegate method, locationManager:didUpdateLocations:. You must set a delegate and implement the delegate that delegate method, and that is where you receive...
objective-c,iphone,ios8,cllocationmanager,cllocation
Instead of using your getLocation method, do all your CLLocationManager initializations when the class is initialized. In your @interface set a property to hold the user's current location: @property (nonatomic, strong) CLLocation *currentLocation; And implement the delegate method -locationManager:didUpdateLocations: like so: - (void)locationManager:(CLLocationManager*)manager didUpdateLocations:(NSArray*)locations { // set the current location....
ios,google-maps,location,cllocationmanager
Just put: self.locationManager.delegate = self; After this line: self.locationManager = [[CLLocationManager alloc] init]; Note: Make sure you have added CLLocationManagerDelegate in your header file....
ios,objective-c,ios8,cllocationmanager
Perhaps it's just the result of a typo. -(void)locationManage: (CLLocationManager *)manager didUpdateLocations:(NSArray*)locations { should be -(void)locationManager: (CLLocationManager *)manager didUpdateLocations:(NSArray*)locations { You forgot the "r" at the end of "locationManager"....
ios,objective-c,xcode,cllocationmanager
Without knowing where you had placed your code, the way I would approach this issue is Create a method that asks for location access i.e. - (void) findLocationAsk Now don't call this method right on app launch as you didn't want that behavior Call this method in your view controller...
ios,objective-c,core-location,cllocationmanager
Standard location is something your app does. Thus your app needs to be running. It can operate in the foreground or you can even run in the background. But if your app is not running, it's not running; there is nothing to track. Significant location monitoring and region monitoring, on...
ios,cllocationmanager,ibeacon,indoor-positioning-system
The CLBeacon class contains three properties which are related to the distance between the beacon transmitter and the receiving device: rssi: The Received Signal Strength Indicator, measured in dBm, tells how strong the beacon signal was as averaged over the last one second ranging cycle. It originates from the radio...
nsdateformatter,cllocationmanager
Try using this as your format: @"yyyy-MM-dd HH:mm:ss zzz" This now works fine for me: This is swift in the picture, but the important part is the date format string. That is language independent and I just wanted to show you that it was working. Replacing the format string in...
ios,objective-c,core-location,cllocationmanager
When you DashBoardViewController *dash=[[DashBoardViewController alloc] init]; it creates a new DashBoardViewController instance. You can define locationManager in AppDelegate and access directly to it from anywhere in your code. AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.locationManager = nil; ...
ios,objective-c,mapkit,cllocationmanager
In order to request extra time for your app to run in the background to complete its tasks (asynchronous or not), you can use beginBackgroundTaskWithExpirationHandler:. For example: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { // If the application is in the background... if([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive) { //...
I see several issues with what you posted, here are just two: You are calling locationManager.startUpdatingLocation() from viewDidLoad this will only fire if the view is not already loaded into memory. Recommend moving this into viewWillAppear so it fires every time. This code should be rewritten: if (locationManager.respondsToSelector(Selector("requestWhenInUseAuthorization"))) { locationManager.requestWhenInUseAuthorization()...
ios,swift,cllocationmanager,cllocation
First,make sure you have this key in plist Second,request location service in viewDidLoad,I test with these code import UIKit import CoreLocation class ViewController: UIViewController,CLLocationManagerDelegate { var manager:CLLocationManager! override func viewDidLoad() { super.viewDidLoad() manager = CLLocationManager() manager.delegate = self if(NSString(string:UIDevice.currentDevice().systemVersion).doubleValue >= 8.0){ manager.requestWhenInUseAuthorization() } // Do any additional setup after loading...
ios,objective-c,location,cllocationmanager,clcircularregion
region monitoring - it's not working with requestWhenInUseAuthorization check Apple Docs: ".. “when-in-use” ... Apps cannot use any services that automatically relaunch the app, such as region monitoring or the significant location change service" You must call requestAlwaysAuthorization!!! https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/requestWhenInUseAuthorization...
ios,google-maps,gps,cllocationmanager
Assigning myLocationEnabled property to NO should do the job. Here is the code: self.googleMapView.myLocationEnabled = NO; ...
ios,xamarin,geolocation,cllocationmanager,xamarin.forms
Did you add these keys to your Info.plist file? <key>NSLocationAlwaysUsageDescription</key> <string>Your message goes here</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Your message goes here</string> ...
You cannot not know whether startUpdatingLocation() is "active" because you are the one who said it. If you need to keep track of this from elsewhere, make a Bool property and set it to true when you call startUpdatingLocation() and to false when you call stopUpdatingLocation()....
While moving to background or when app terminated call this method startMonitoringSignificantLocationChanges(); So if you reboot your device or app got killed, whenever there is significant location change in your location, OS will launch your app in background. As per apple document If you start this service and your app...
ios,ios7,swift,ios8,cllocationmanager
If the app was terminated, you could not run any program for the app. And it's not always to handle applicationWillTerminate function when the app was terminated. In some situations, the system kills the app without any notification. Please read the document about application life cycle. https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html I think you...