Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose live location sharing labs flag (default: false) and re-enable background location access (PSF-1127) #6324

Merged
merged 4 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion Riot/Managers/Settings/RiotSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this should still use a BuildSettings value

var enableLiveLocationSharing

// MARK: Calls
Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/LocationSharing/UserLocationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions Riot/SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>location</string>
<string>remote-notification</string>
<string>voip</string>
</array>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-6324.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose live location sharing labs flag (default: false) and re-enable background location access