Get last known location

Get last known location

GetLastKnownLocation

Overview

GetLastKownLocation API provides the last known location. On iOS, the method returns a CLLocation object. However, it requires at least one running service otherwise it will return a null object.

Example



- (IBAction)onGetLastLocationBtnPressed:(UIButton *)sender {
    CLLocation *location = [[NAOServicesConfig getNaoContext] getLastKnownLocation];
    self.lastLocConsoleLabel.text = [NSString stringWithFormat:@"%.6f, %.6f, %.3f, %.2f, 
      HozAccuracy : %.2f, VerAccuracy : %.2f", location.coordinate.longitude,
      location.coordinate.latitude, location.altitude, location.course, 
      location.horizontalAccuracy,location.verticalAccuracy];
}
    • Related Articles

    • Get last known location

      GetLastKnownLocation Overview GetLastKownLocation API provides the last known location. On Android, the method returns a Location object. However, it requires at least one running service otherwise it will return a null object. Example On Android ...
    • Location API

      Overview Location API can be used to receive location information about all tags of a given site. Once subscribed to a topic, your application will receive MQTT messages. Each message contains a topic and a payload. Refer ot the “Connection and ...
    • Quick Start: Location Service

      The integration principle is the same accross all SDK services, so only the integration of the Location Service is detailed hereafter. Please refer to the API Reference Guide for details about other services. Initialize Location Service Import the ...
    • Restart the location service

      Overview NAOLocationHandle class provides the restart method that stops and stars the location service and therefore re-initializes the environment and variables are being used. However, we strongly recommend that you avoid calling this method ...
    • Restart the location service

      Overview NAOLocationHandle class provides the restart method that stops and stars the location service and therefore re-initializes the environment and variables are being used. However, we strongly recommend that you avoid calling this method ...