/// <summary> /// Stops the generation of location updates. /// /// Call this method whenever your code no longer needs to receive location-related events. /// Disabling event delivery gives the receiver the option of disabling the appropriate hardware (and thereby saving power) /// when no clients need location data. /// You can always restart the generation of location updates by calling the startUpdatingLocation method again. /// </summary> public static void StopUpdatingLocation() { ISN_CLNativeAPI.StopUpdatingLocation(); }
/// <summary> /// Requests the one-time delivery of the user’s current location. /// /// This method returns immediately. /// Calling it causes the location manager to obtain a location fix (which may take several seconds) /// and call the delegate’s DidUpdateLocations method with the result. /// The location fix is obtained at the accuracy level indicated by the <see cref="SetDesiredAccuracy"/> method. /// Only one location fix is reported to the delegate, after which location services are stopped. /// If a location fix cannot be determined in a timely manner, /// the location manager calls the delegate’s SidFailWithError method instead and reports a kCLErrorLocationUnknown error. /// /// Use this method when you want the user’s current location but do not need to leave location services running. /// This method starts location services long enough to return a result or report an error and then stops them again. /// Calling the <see cref="StartUpdatingLocation"/> method cancels any pending request made using this method. /// Calling this method while location services are already running does nothing. /// To cancel a pending request, call the <see cref="StopUpdatingLocation"/> method. /// /// If obtaining the desired accuracy would take too long, /// the location manager delivers a less accurate location value rather than reporting an error. /// /// When using this method, the associated delegate must implement the DidUpdateLocations DidFailWithError methods. /// Failure to do so is a programmer error. /// </summary> public static void RequestLocation() { ISN_CLNativeAPI.RequestLocation(); }
/// <summary> /// Requests permission to use location services whenever the app is running. /// </summary> public static void RequestWhenInUseAuthorization() { ISN_CLNativeAPI.RequestWhenInUseAuthorization(); }
/// <summary> /// Requests permission to use location services while the app is in the foreground. /// </summary> public static void RequestAlwaysAuthorization() { ISN_CLNativeAPI.RequestAlwaysAuthorization(); }
/// <summary> /// Set location service delegate. /// </summary> /// <param name="delegate">The delegate object to receive update events.</param> public static void SetDelegate(ISN_iCLLocationManagerDelegate @delegate) { ISN_CLNativeAPI.SetDelegate(@delegate); }
/// <summary> /// The accuracy of the location data. /// /// The receiver does its best to achieve the requested accuracy; however, the actual accuracy is not guaranteed. /// You should assign a value to this property that is appropriate for your usage scenario. /// For example, if you need the current location only within a kilometer, you should specify <see cref="ISN_CLLocationAccuracy.Kilometer"/> /// and not <see cref="ISN_CLLocationAccuracy.BestForNavigation"/>. /// Determining a location with greater accuracy requires more time and more power. /// /// When requesting high-accuracy location data, /// the initial event delivered by the location service may not have the accuracy you requested. /// The location service delivers the initial event as quickly as possible. /// It then continues to determine the location with the accuracy you requested and delivers additional events, /// as necessary, when that data is available. /// /// For iOS and macOS, the default value of this property is <see cref="ISN_CLLocationAccuracy.Best"/>. /// For watchOS, the default value is <see cref="ISN_CLLocationAccuracy.HundredMeters"/>. /// </summary> public static void SetDesiredAccuracy(ISN_CLLocationAccuracy value) { ISN_CLNativeAPI.SetDesiredAccuracy(value); }