From f48ed054e41ed50bc54df7240b27fb40d820738a Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Thu, 15 Aug 2024 21:09:49 +0400 Subject: [PATCH] [ios] add checkLocationStatus to the LocationManager To check location availability on start track recording Signed-off-by: Kiryl Kaveryn --- iphone/Maps/Core/Location/MWMLocationManager.h | 1 + iphone/Maps/Core/Location/MWMLocationManager.mm | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/iphone/Maps/Core/Location/MWMLocationManager.h b/iphone/Maps/Core/Location/MWMLocationManager.h index f5e3f7c366..e662c47921 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.h +++ b/iphone/Maps/Core/Location/MWMLocationManager.h @@ -14,6 +14,7 @@ NS_SWIFT_NAME(LocationManager) + (void)removeObserver:(id)observer NS_SWIFT_NAME(remove(observer:)); + (void)setMyPositionMode:(MWMMyPositionMode)mode; ++ (void)checkLocationStatus; + (nullable CLLocation *)lastLocation; + (BOOL)isLocationProhibited; diff --git a/iphone/Maps/Core/Location/MWMLocationManager.mm b/iphone/Maps/Core/Location/MWMLocationManager.mm index 991aa6cd30..d97c6df339 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.mm +++ b/iphone/Maps/Core/Location/MWMLocationManager.mm @@ -368,6 +368,12 @@ void setShowLocationAlert(BOOL needShow) { } } ++ (void)checkLocationStatus +{ + setShowLocationAlert(YES); + [self.manager processLocationStatus:self.manager.lastLocationStatus]; +} + #pragma mark - Prediction - (MWMLocationPredictor *)predictor