Skip to content

Commit

Permalink
Merge pull request #983 from tchapgouv/970-etude-activer-la-geolocali…
Browse files Browse the repository at this point in the history
…sation

970 etude activer la geolocalisation
  • Loading branch information
NicolasBuquet authored Mar 26, 2024
2 parents 1c281a8 + d308851 commit ffae756
Show file tree
Hide file tree
Showing 25 changed files with 371 additions and 321 deletions.
12 changes: 9 additions & 3 deletions Btchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ final class BuildSettings: NSObject {
static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail"
static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP"
static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" // Tchap: in pre-prod, allow any feature to any instance.
static let tchapFeatureGeolocationSharing = "tchapFeatureGeolocationSharing" // linked to `locationSharingEnabled` property (see above)
static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [
tchapFeatureAnyFeature: [ tchapFeatureAnyHomeServer ]
]
Expand Down Expand Up @@ -413,9 +414,14 @@ final class BuildSettings: NSObject {
// MARK: - Location Sharing

/// Overwritten by the home server's .well-known configuration (if any exists)
static let defaultTileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=")!

static let locationSharingEnabled = false // Currently disabled in Tchap.
// Tchap: handle different map providers.
private enum TchapMapProvider: String {
case geoDataGouv = "https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json"
case ign = "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json"
}
static let defaultTileServerMapStyleURL = URL(string: TchapMapProvider.geoDataGouv.rawValue)!

static let locationSharingEnabled = true

// MARK: - Voice Broadcast
static let voiceBroadcastChunkLength: Int = 120
Expand Down
11 changes: 8 additions & 3 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,14 @@ final class BuildSettings: NSObject {
// MARK: - Location Sharing

/// Overwritten by the home server's .well-known configuration (if any exists)
static let defaultTileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=")!

static let locationSharingEnabled = false // Currently disabled in Tchap.
// Tchap: handle different map providers.
private enum TchapMapProvider: String {
case geoDataGouv = "https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json"
case ign = "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json"
}
static let defaultTileServerMapStyleURL = URL(string: TchapMapProvider.geoDataGouv.rawValue)!

static let locationSharingEnabled = true

// MARK: - Voice Broadcast
static let voiceBroadcastChunkLength: Int = 120
Expand Down
12 changes: 9 additions & 3 deletions DevTchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ final class BuildSettings: NSObject {
static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail"
static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP"
static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" // Tchap: in Dev, allow any feature to any instance.
static let tchapFeatureGeolocationSharing = "tchapFeatureGeolocationSharing" // linked to `locationSharingEnabled` property (see above)
static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [
tchapFeatureAnyFeature: [ tchapFeatureAnyHomeServer ]
]
Expand Down Expand Up @@ -414,9 +415,14 @@ final class BuildSettings: NSObject {
// MARK: - Location Sharing

/// Overwritten by the home server's .well-known configuration (if any exists)
static let defaultTileServerMapStyleURL = URL(string: "https://api.maptiler.com/maps/streets/style.json?key=")!

static let locationSharingEnabled = false // Currently disabled in Tchap.
// Tchap: handle different map providers.
private enum TchapMapProvider: String {
case geoDataGouv = "https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json"
case ign = "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json"
}
static let defaultTileServerMapStyleURL = URL(string: TchapMapProvider.geoDataGouv.rawValue)!

static let locationSharingEnabled = true

// MARK: - Voice Broadcast
static let voiceBroadcastChunkLength: Int = 120
Expand Down
4 changes: 2 additions & 2 deletions Riot/Assets/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
"NSContactsUsageDescription" = "In order to show who among your contacts already uses Tchap, we can exploit the e-mail addresses of your address book. These data will not be stored. For more information, please visit the privacy policy page in the app settings.";
"NSCalendarsUsageDescription" = "See your scheduled meetings in the app.";
"NSFaceIDUsageDescription" = "Face ID is used to access your app.";
"NSLocationWhenInUseUsageDescription" = "When you share your location to people, Element needs access to show them a map.";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "When you share your location to people, Element needs access to show them a map.";
"NSLocationWhenInUseUsageDescription" = "When you share your location to people, Tchap needs access to show them a map.";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "When you share your location to people, Tchap needs access to show them a map.";
4 changes: 2 additions & 2 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2453,8 +2453,8 @@ Tap the + to start adding people.";
"location_sharing_settings_toggle_title" = "Enable location sharing";

"location_sharing_allow_background_location_title" = "Allow access";
"location_sharing_allow_background_location_message" = "If you’d like to share your Live location, Element needs location access when the app is in the background.
To enable access, tap Settings> Location and select Always";
"location_sharing_allow_background_location_message" = "If you’d like to share your Live location, Tchap needs location access when the app is in the background.
To enable access, tap Settings> Location and select Always"; // Tchap
"location_sharing_allow_background_location_validate_action" = "Settings";
"location_sharing_allow_background_location_cancel_action" = "Not now";
"location_sharing_map_credits_title" = "© Copyright";
Expand Down
2 changes: 2 additions & 0 deletions Riot/Assets/fr.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
"NSMicrophoneUsageDescription" = "Tchap nécessite l'accès au microphone pour réaliser des vidéos avec la caméra, ou pour enregistrer des messages vocaux.";
"NSContactsUsageDescription" = "Afin d’afficher qui parmi vos contacts utilise déjà Tchap, nous pouvons exploiter les adresses e-mails de votre carnet d'adresse. Ces données ne seront pas mémorisées. Pour plus d'informations, veuillez consulter les Termes et Conditions disponibles dans les paramètres de l'application.";
"NSFaceIDUsageDescription" = "Face ID est utilisé pour accéder à votre application.";
"NSLocationWhenInUseUsageDescription" = "Lorsque vous partagez votre position, Tchap a besoin de votre autorisation pour l'afficher sur une carte.";
"NSLocationAlwaysAndWhenInUseUsageDescription" = "Lorsque vous partagez votre position, Tchap a besoin de votre autorisation pour l'afficher sur une carte.";
2 changes: 1 addition & 1 deletion Riot/Assets/fr.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@
"authentication_registration_title" = "Créez votre compte";
"room_access_settings_screen_upgrade_alert_title" = "Mettre à niveau le salon";
"room_access_settings_screen_upgrade_required" = "Mise à niveau requise";
"location_sharing_allow_background_location_message" = "Si vous voulez partager votre localisation en temps réel, Element doit avoir accès à vos données de localisation lorsque l’application est en arrière-plan. Pour lui donner accès, rendez-vous dans Réglages > Position et sélectionnez Toujours";
"location_sharing_allow_background_location_message" = "Si vous voulez partager votre localisation en temps réel, Tchap doit avoir accès à vos données de localisation lorsque l’application est en arrière-plan. Pour lui donner accès, rendez-vous dans Réglages > Position et sélectionnez Toujours"; // Tchap
"settings_timeline" = "HISTORIQUE";
"authentication_server_selection_login_title" = "Connexion à un serveur d’accueil";
"message_reply_to_sender_sent_their_live_location" = "Localisation en temps réel.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ final class HomeserverConfiguration: NSObject {
// Note: Use an object per configuration subject when there is multiple properties related
let jitsi: HomeserverJitsiConfiguration
let encryption: HomeserverEncryptionConfiguration
// let tileServer: HomeserverTileServerConfiguration
let tileServer: HomeserverTileServerConfiguration

init(jitsi: HomeserverJitsiConfiguration,
encryption: HomeserverEncryptionConfiguration/*,
tileServer: HomeserverTileServerConfiguration*/) {
encryption: HomeserverEncryptionConfiguration,
tileServer: HomeserverTileServerConfiguration) {
self.jitsi = jitsi
self.encryption = encryption
// self.tileServer = tileServer
self.tileServer = tileServer
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ final class HomeserverConfigurationBuilder: NSObject {

// Tile server configuration

// let tileServerMapStyleURL: URL
// if let mapStyleURLString = wellKnown?.tileServer?.mapStyleURLString,
// let mapStyleURL = URL(string: mapStyleURLString) {
// tileServerMapStyleURL = mapStyleURL
// } else {
// tileServerMapStyleURL = BuildSettings.defaultTileServerMapStyleURL
// }
//
// let tileServerConfiguration = HomeserverTileServerConfiguration(mapStyleURL: tileServerMapStyleURL)
let tileServerMapStyleURL: URL
if let mapStyleURLString = wellKnown?.tileServer?.mapStyleURLString,
let mapStyleURL = URL(string: mapStyleURLString) {
tileServerMapStyleURL = mapStyleURL
} else {
tileServerMapStyleURL = BuildSettings.defaultTileServerMapStyleURL
}

let tileServerConfiguration = HomeserverTileServerConfiguration(mapStyleURL: tileServerMapStyleURL)

// Create HomeserverConfiguration

Expand All @@ -95,8 +95,8 @@ final class HomeserverConfigurationBuilder: NSObject {
useFor1To1Calls: useJitsiFor1To1Calls)

return HomeserverConfiguration(jitsi: jitsiConfiguration,
encryption: encryptionConfiguration/*,
tileServer: tileServerConfiguration*/)
encryption: encryptionConfiguration,
tileServer: tileServerConfiguration)
}

// MARK: - Private
Expand Down
Loading

0 comments on commit ffae756

Please sign in to comment.