diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift
index b246aac59b..e9ee04a456 100644
--- a/Config/BuildSettings.swift
+++ b/Config/BuildSettings.swift
@@ -410,24 +410,5 @@ final class BuildSettings: NSObject {
static let tileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx")!
- static var locationSharingEnabled: Bool {
- guard #available(iOS 14, *) else {
- return false
- }
-
- return true
- }
-
- static var liveLocationSharingEnabled: Bool {
- guard #available(iOS 14, *) else {
- return false
- }
-
- guard self.locationSharingEnabled else {
- return false
- }
-
- // Do not enable live location sharing atm
- return false
- }
+ static let locationSharingEnabled = true
}
diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift
index d2cabfcfab..6349198142 100644
--- a/Riot/Managers/Settings/RiotSettings.swift
+++ b/Riot/Managers/Settings/RiotSettings.swift
@@ -153,7 +153,7 @@ final class RiotSettings: NSObject {
var enableUISIAutoReporting
/// Indicates if live location sharing is enabled
- @UserDefault(key: UserDefaultsKeys.enableLiveLocationSharing, defaultValue: BuildSettings.liveLocationSharingEnabled, storage: defaults)
+ @UserDefault(key: UserDefaultsKeys.enableLiveLocationSharing, defaultValue: false, storage: defaults)
var enableLiveLocationSharing
// MARK: Calls
diff --git a/Riot/Modules/LocationSharing/UserLocationService.swift b/Riot/Modules/LocationSharing/UserLocationService.swift
index f9c04aaef4..1a2abc0a57 100644
--- a/Riot/Modules/LocationSharing/UserLocationService.swift
+++ b/Riot/Modules/LocationSharing/UserLocationService.swift
@@ -52,7 +52,7 @@ class UserLocationService: UserLocationServiceProtocol {
// MARK: - Setup
init(session: MXSession) {
- self.locationManager = LocationManager(accuracy: .full, allowsBackgroundLocationUpdates: false)
+ self.locationManager = LocationManager(accuracy: .full, allowsBackgroundLocationUpdates: BuildSettings.locationSharingEnabled)
self.session = session
}
diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m
index 722d6ac771..c60d435de7 100644
--- a/Riot/Modules/Settings/SettingsViewController.m
+++ b/Riot/Modules/Settings/SettingsViewController.m
@@ -595,9 +595,8 @@ - (void)updateSections
[sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX];
[sectionLabs addRowWithTag:LABS_ENABLE_AUTO_REPORT_DECRYPTION_ERRORS];
- if (BuildSettings.liveLocationSharingEnabled)
+ if (BuildSettings.locationSharingEnabled)
{
- // Hide live location lab setting until it's ready to be release
[sectionLabs addRowWithTag:LABS_ENABLE_LIVE_LOCATION_SHARING];
}
sectionLabs.headerTitle = [VectorL10n settingsLabs];
diff --git a/Riot/SupportingFiles/Info.plist b/Riot/SupportingFiles/Info.plist
index 537f72d95c..668798a9ac 100644
--- a/Riot/SupportingFiles/Info.plist
+++ b/Riot/SupportingFiles/Info.plist
@@ -89,6 +89,7 @@
UIBackgroundModes
audio
+ location
remote-notification
voip
diff --git a/RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingModels.swift b/RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingModels.swift
index ec9eb58bd3..b819e303ef 100644
--- a/RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingModels.swift
+++ b/RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingModels.swift
@@ -78,7 +78,7 @@ struct LocationSharingViewState: BindableState {
/// True to indicate to show and follow current user location
var showsUserLocation: Bool = false
- /// Used to hide live location sharing features until is finished
+ /// Used to hide live location sharing features
var isLiveLocationSharingEnabled: Bool = false
var shareButtonEnabled: Bool {
diff --git a/changelog.d/pr-6324.change b/changelog.d/pr-6324.change
new file mode 100644
index 0000000000..3e9df96662
--- /dev/null
+++ b/changelog.d/pr-6324.change
@@ -0,0 +1 @@
+Expose live location sharing labs flag (default: false) and re-enable background location access