diff --git a/Btchap/SupportingFiles/Btchap-App-Common.xcconfig b/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
index 36a5963707..0c9357856d 100644
--- a/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
+++ b/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
@@ -24,6 +24,7 @@ BUNDLE_DISPLAY_NAME = Btchap
BASE_BUNDLE_IDENTIFIER = fr.gouv.btchap
APPLICATION_GROUP_IDENTIFIER = group.$(BASE_BUNDLE_IDENTIFIER)
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER)
+APPLICATION_SCHEME = tchap
INFOPLIST_FILE = Btchap/SupportingFiles/Info.plist
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
diff --git a/Btchap/SupportingFiles/Info.plist b/Btchap/SupportingFiles/Info.plist
index 5e06e305b9..262b052c3d 100644
--- a/Btchap/SupportingFiles/Info.plist
+++ b/Btchap/SupportingFiles/Info.plist
@@ -35,6 +35,19 @@
$(MARKETING_VERSION)
CFBundleSignature
????
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLName
+ $(BASE_BUNDLE_IDENTIFIER)
+ CFBundleURLSchemes
+
+ $(APPLICATION_SCHEME)
+
+
+
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
ITSAppUsesNonExemptEncryption
diff --git a/DevTchap/SupportingFiles/DevTchap-App-Common.xcconfig b/DevTchap/SupportingFiles/DevTchap-App-Common.xcconfig
index 5fe20ec985..ae7b765ca3 100644
--- a/DevTchap/SupportingFiles/DevTchap-App-Common.xcconfig
+++ b/DevTchap/SupportingFiles/DevTchap-App-Common.xcconfig
@@ -24,6 +24,7 @@ BUNDLE_DISPLAY_NAME = DevTchap
BASE_BUNDLE_IDENTIFIER = fr.gouv.tchap.dev
APPLICATION_GROUP_IDENTIFIER = group.$(BASE_BUNDLE_IDENTIFIER)
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER)
+APPLICATION_SCHEME = tchap
INFOPLIST_FILE = DevTchap/SupportingFiles/Info.plist
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
diff --git a/DevTchap/SupportingFiles/Info.plist b/DevTchap/SupportingFiles/Info.plist
index 4303301c18..533722fc3c 100644
--- a/DevTchap/SupportingFiles/Info.plist
+++ b/DevTchap/SupportingFiles/Info.plist
@@ -35,6 +35,19 @@
$(MARKETING_VERSION)
CFBundleSignature
????
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLName
+ $(BASE_BUNDLE_IDENTIFIER)
+ CFBundleURLSchemes
+
+ $(APPLICATION_SCHEME)
+
+
+
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
ITSAppUsesNonExemptEncryption
diff --git a/Riot/Modules/Authentication/AuthenticationCoordinator.swift b/Riot/Modules/Authentication/AuthenticationCoordinator.swift
index 295a591f73..b47c20b3bc 100644
--- a/Riot/Modules/Authentication/AuthenticationCoordinator.swift
+++ b/Riot/Modules/Authentication/AuthenticationCoordinator.swift
@@ -151,7 +151,9 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
if authenticationService.state.homeserver.needsRegistrationFallback {
showFallback(for: flow)
} else {
- showRegistrationScreen()
+ // Tchap: force email registration mode
+// showRegistrationScreen()
+ TchapShowVerifyEmailScreen()
}
case .login:
if authenticationService.state.homeserver.needsLoginFallback {
@@ -379,6 +381,38 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
}
}
+ // Tchap: start Registration with VerifyEmail screen
+ /// Shows the login screen.
+ @MainActor private func TchapShowVerifyEmailScreen() {
+ MXLog.debug("[AuthenticationCoordinator] TchapShowVerifyEmailScreen")
+
+ guard let registrationWizard = authenticationService.registrationWizard else {
+ MXLog.failure("[AuthenticationCoordinator] showStage: Missing the RegistrationWizard needed to complete the stage.")
+ displayError(message: VectorL10n.errorCommonMessage)
+ return
+ }
+ let homeserver = authenticationService.state.homeserver
+
+ let parameters = AuthenticationVerifyEmailCoordinatorParameters(registrationWizard: registrationWizard,
+ homeserver: authenticationService.state.homeserver)
+ let coordinator = AuthenticationVerifyEmailCoordinator(parameters: parameters)
+ coordinator.callback = { [weak self] result in
+ self?.registrationStageDidComplete(with: result)
+ }
+
+ coordinator.start()
+ add(childCoordinator: coordinator)
+
+ if navigationRouter.modules.isEmpty {
+ navigationRouter.setRootModule(coordinator, popCompletion: nil)
+ } else {
+ navigationRouter.push(coordinator, animated: true) { [weak self] in
+ self?.remove(childCoordinator: coordinator)
+ }
+ }
+ }
+
+
/// Displays the next view in the flow based on the result from the registration screen.
@MainActor private func registrationCoordinator(_ coordinator: AuthenticationRegistrationCoordinator,
didCallbackWith result: AuthenticationRegistrationCoordinatorResult) {
diff --git a/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m b/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m
index c0605d8131..687a534e27 100644
--- a/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m
+++ b/Riot/Modules/Authentication/Legacy/AuthenticationViewController.m
@@ -138,10 +138,10 @@ - (void)viewDidLoad
}
else
{
- self.defaultHomeServerUrl = RiotSettings.shared.homeserverUrlString;
+// self.defaultHomeServerUrl = RiotSettings.shared.homeserverUrlString;
}
- self.defaultIdentityServerUrl = RiotSettings.shared.identityServerUrlString;
+// self.defaultIdentityServerUrl = RiotSettings.shared.identityServerUrlString;
self.welcomeImageView.image = AssetSharedImages.horizontalLogo.image;
diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift
index 0efb816e23..f7e4f51066 100644
--- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift
+++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift
@@ -107,8 +107,6 @@ class AllChatsViewController: HomeViewController {
// Reference to the current onboarding flow. It is always nil unless the flow is being presented.
private(set) var onboardingCoordinatorBridgePresenter: OnboardingCoordinatorBridgePresenter?
- // Tchap: Use welcomeCoordinator instead of onboardingCoordinator
- private(set) var welcomeCoordinatorBridgePresenter: WelcomeCoordinatorBridgePresenter?
// Tell whether the onboarding screen is preparing.
private(set) var isOnboardingInProgress: Bool = false
@@ -921,8 +919,7 @@ extension AllChatsViewController: SplitViewMasterViewControllerProtocol {
// This method can be called after the user chooses to clear their data as the MXSession
// is opened to call logout from. So we only set the credentials when authentication isn't
// in progress to prevent a second soft logout screen being shown.
- // Tchap: Use WelcomeCoordinatorBridgePresenter instead of OnboardingCoordinatorBridgePresenter
- guard self.welcomeCoordinatorBridgePresenter == nil && !self.isOnboardingCoordinatorPreparing else {
+ guard self.self.onboardingCoordinatorBridgePresenter == nil && !self.isOnboardingCoordinatorPreparing else {
return
}
@@ -1092,8 +1089,7 @@ extension AllChatsViewController: SplitViewMasterViewControllerProtocol {
private func showOnboardingFlowAndResetSessionFlags(_ resetSessionFlags: Bool) {
// Check whether an authentication screen is not already shown or preparing
- // Tchap: Use WelcomeCoordinatorBridgePresenter instead of OnboardingCoordinatorBridgePresenter
- guard self.welcomeCoordinatorBridgePresenter == nil && !self.isOnboardingCoordinatorPreparing else {
+ guard self.self.onboardingCoordinatorBridgePresenter == nil && !self.isOnboardingCoordinatorPreparing else {
return
}
@@ -1117,36 +1113,36 @@ extension AllChatsViewController: SplitViewMasterViewControllerProtocol {
MXLog.debug("[AllChatsViewController] presentOnboardingFlow")
// Tchap: Use WelcomeCoordinatorBridgePresenter instead of OnboardingCoordinatorBridgePresenter
- let welcomeCoordinatorBridgePresenter = WelcomeCoordinatorBridgePresenter()
- welcomeCoordinatorBridgePresenter.completion = { [weak self] in
- guard let self = self else { return }
-
- self.welcomeCoordinatorBridgePresenter?.dismiss(animated: true, completion: {
- self.welcomeCoordinatorBridgePresenter = nil
- })
-
- self.isOnboardingInProgress = false // Must be set before calling didCompleteAuthentication
- self.allChatsDelegate?.allChatsViewControllerDidCompleteAuthentication(self)
- }
-
- welcomeCoordinatorBridgePresenter.present(from: self, animated: true)
- self.welcomeCoordinatorBridgePresenter = welcomeCoordinatorBridgePresenter
-
-
-// let onboardingCoordinatorBridgePresenter = OnboardingCoordinatorBridgePresenter()
-// onboardingCoordinatorBridgePresenter.completion = { [weak self] in
+// let welcomeCoordinatorBridgePresenter = WelcomeCoordinatorBridgePresenter()
+// welcomeCoordinatorBridgePresenter.completion = { [weak self] in
// guard let self = self else { return }
-//
-// self.onboardingCoordinatorBridgePresenter?.dismiss(animated: true, completion: {
-// self.onboardingCoordinatorBridgePresenter = nil
+//
+// self.welcomeCoordinatorBridgePresenter?.dismiss(animated: true, completion: {
+// self.welcomeCoordinatorBridgePresenter = nil
// })
//
// self.isOnboardingInProgress = false // Must be set before calling didCompleteAuthentication
// self.allChatsDelegate?.allChatsViewControllerDidCompleteAuthentication(self)
// }
//
-// onboardingCoordinatorBridgePresenter.present(from: self, animated: true)
-// self.onboardingCoordinatorBridgePresenter = onboardingCoordinatorBridgePresenter
+// welcomeCoordinatorBridgePresenter.present(from: self, animated: true)
+// self.welcomeCoordinatorBridgePresenter = welcomeCoordinatorBridgePresenter
+
+
+ let onboardingCoordinatorBridgePresenter = OnboardingCoordinatorBridgePresenter()
+ onboardingCoordinatorBridgePresenter.completion = { [weak self] in
+ guard let self = self else { return }
+
+ self.onboardingCoordinatorBridgePresenter?.dismiss(animated: true, completion: {
+ self.onboardingCoordinatorBridgePresenter = nil
+ })
+
+ self.isOnboardingInProgress = false // Must be set before calling didCompleteAuthentication
+ self.allChatsDelegate?.allChatsViewControllerDidCompleteAuthentication(self)
+ }
+
+ onboardingCoordinatorBridgePresenter.present(from: self, animated: true)
+ self.onboardingCoordinatorBridgePresenter = onboardingCoordinatorBridgePresenter
self.isOnboardingCoordinatorPreparing = false
}
diff --git a/Riot/Modules/Onboarding/OnboardingCoordinator.swift b/Riot/Modules/Onboarding/OnboardingCoordinator.swift
index bce47443bb..3fb1d711a6 100644
--- a/Riot/Modules/Onboarding/OnboardingCoordinator.swift
+++ b/Riot/Modules/Onboarding/OnboardingCoordinator.swift
@@ -165,7 +165,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
case .register:
// Tchap: Bypass usecase selection screen
// showUseCaseSelectionScreen()
- MXLog.failure("[OnboardingCoordinator] splashScreenCoordinator register case should not happen !")
+ beginAuthentication(with: .registration, onStart: coordinator.stop)
case .login:
if BuildSettings.onboardingEnableNewAuthenticationFlow {
diff --git a/Riot/Modules/SplitView/SplitViewCoordinator.swift b/Riot/Modules/SplitView/SplitViewCoordinator.swift
index 61271f31bc..22172510cc 100644
--- a/Riot/Modules/SplitView/SplitViewCoordinator.swift
+++ b/Riot/Modules/SplitView/SplitViewCoordinator.swift
@@ -93,7 +93,9 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType {
self.splitViewController.delegate = self
// Create primary controller
- let masterCoordinator: SplitViewMasterCoordinatorProtocol = BuildSettings.newAppLayoutEnabled ? self.createAllChatsCoordinator() : self.createTabBarCoordinator()
+ // Tchap: force using AllChatsCoordinator because newLayout is always TRUE
+// let masterCoordinator: SplitViewMasterCoordinatorProtocol = BuildSettings.newAppLayoutEnabled ? self.createAllChatsCoordinator() : self.createTabBarCoordinator()
+ let masterCoordinator: SplitViewMasterCoordinatorProtocol = self.createAllChatsCoordinator()
masterCoordinator.splitViewMasterPresentableDelegate = self
masterCoordinator.start(with: spaceId)
@@ -182,14 +184,15 @@ final class SplitViewCoordinator: NSObject, SplitViewCoordinatorType {
return coordinator
}
- private func createTabBarCoordinator() -> TabBarCoordinator {
-
- let coordinatorParameters = TabBarCoordinatorParameters(userSessionsService: self.parameters.userSessionsService, appNavigator: self.parameters.appNavigator)
-
- let tabBarCoordinator = TabBarCoordinator(parameters: coordinatorParameters)
- tabBarCoordinator.delegate = self
- return tabBarCoordinator
- }
+ // Tchap: don't use TabBarCoordinator anymore now that newLayout is always TRUE
+// private func createTabBarCoordinator() -> TabBarCoordinator {
+//
+// let coordinatorParameters = TabBarCoordinatorParameters(userSessionsService: self.parameters.userSessionsService, appNavigator: self.parameters.appNavigator)
+//
+// let tabBarCoordinator = TabBarCoordinator(parameters: coordinatorParameters)
+// tabBarCoordinator.delegate = self
+// return tabBarCoordinator
+// }
private func resetDetailNavigationControllerWithPlaceholder(animated: Bool) {
guard let detailNavigationRouter = self.detailNavigationRouter else {
diff --git a/Riot/Modules/TabBar/TabBarCoordinator.swift b/Riot/Modules/TabBar/TabBarCoordinator.swift
index b3ce06ba84..bbee1ab268 100644
--- a/Riot/Modules/TabBar/TabBarCoordinator.swift
+++ b/Riot/Modules/TabBar/TabBarCoordinator.swift
@@ -639,13 +639,14 @@ final class TabBarCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
}
private func showWelcome(animated: Bool = false) {
- let welcomeCoordinator = WelcomeCoordinator()
- welcomeCoordinator.delegate = self
- welcomeCoordinator.start()
- self.add(childCoordinator: welcomeCoordinator)
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.5 , execute: { [weak self] in
- self?.navigationRouter.present(welcomeCoordinator, animated: animated)
- })
+ // Tchap: remove calls to Welcome classes
+// let welcomeCoordinator = WelcomeCoordinator()
+// welcomeCoordinator.delegate = self
+// welcomeCoordinator.start()
+// self.add(childCoordinator: welcomeCoordinator)
+// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5 , execute: { [weak self] in
+// self?.navigationRouter.present(welcomeCoordinator, animated: animated)
+// })
}
private func userDidLogin() -> Bool {
@@ -1163,14 +1164,15 @@ extension TabBarCoordinator: SecureBackupSetupCoordinatorBridgePresenterDelegate
}
// MARK: - WelcomeCoordinatorDelegate
-extension TabBarCoordinator: WelcomeCoordinatorDelegate {
- func welcomeCoordinatorUserDidAuthenticate(_ coordinator: WelcomeCoordinatorType) {
- // Check that the new account actually exists before removing the current coordinator
- if userDidLogin() {
- self.remove(childCoordinator: coordinator)
- }
- }
-}
+// Tchap: remove calls to Tchap Welcome classes
+//extension TabBarCoordinator: WelcomeCoordinatorDelegate {
+// func welcomeCoordinatorUserDidAuthenticate(_ coordinator: WelcomeCoordinatorType) {
+// // Check that the new account actually exists before removing the current coordinator
+// if userDidLogin() {
+// self.remove(childCoordinator: coordinator)
+// }
+// }
+//}
// MARK: - RoomsViewControllerDelegate
extension TabBarCoordinator: RoomsViewControllerDelegate {
diff --git a/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift b/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift
index b342398826..7bb7b80987 100644
--- a/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift
+++ b/RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift
@@ -25,13 +25,14 @@ struct OnboardingSplashScreen: View {
@Environment(\.theme) private var theme
@Environment(\.layoutDirection) private var layoutDirection
- private var isLeftToRight: Bool { layoutDirection == .leftToRight }
- private var pageCount: Int { viewModel.viewState.content.count }
-
- /// A timer to automatically animate the pages.
- @State private var pageTimer: Timer?
- /// The amount of offset to apply when a drag gesture is in progress.
- @State private var dragOffset: CGFloat = .zero
+ // Tchap: remove carousel
+// private var isLeftToRight: Bool { layoutDirection == .leftToRight }
+// private var pageCount: Int { viewModel.viewState.content.count }
+//
+// /// A timer to automatically animate the pages.
+// @State private var pageTimer: Timer?
+// /// The amount of offset to apply when a drag gesture is in progress.
+// @State private var dragOffset: CGFloat = .zero
// MARK: Public
@@ -43,28 +44,41 @@ struct OnboardingSplashScreen: View {
Spacer()
.frame(height: OnboardingMetrics.spacerHeight(in: geometry))
- // The main content of the carousel
- HStack(alignment: .top, spacing: 0) {
- // Add a hidden page at the start of the carousel duplicating the content of the last page
- OnboardingSplashScreenPage(content: viewModel.viewState.content[pageCount - 1])
- .frame(width: geometry.size.width)
-
- ForEach(0.. CGFloat {
- (CGFloat(viewModel.pageIndex + 1) * -geometry.size.width) + dragOffset
- }
-
- // MARK: - Gestures
-
- /// Whether or not a drag gesture is valid or not.
- /// - Parameter width: The gesture's translation width.
- /// - Returns: `true` if there is another page to drag to.
- private func shouldSwipeForTranslation(_ width: CGFloat) -> Bool {
- if viewModel.pageIndex == 0 {
- return isLeftToRight ? width < 0 : width > 0
- } else if viewModel.pageIndex == pageCount - 1 {
- return isLeftToRight ? width > 0 : width < 0
- }
-
- return true
- }
-
- /// Updates the `dragOffset` based on the gesture's value.
- /// - Parameter drag: The drag gesture value to handle.
- private func handleDragGestureChange(_ drag: DragGesture.Value) {
- guard shouldSwipeForTranslation(drag.translation.width) else { return }
-
- stopTimer()
-
- // Animate the change over a few frames to smooth out any stuttering.
- withAnimation(.linear(duration: 0.05)) {
- dragOffset = isLeftToRight ? drag.translation.width : -drag.translation.width
- }
- }
+ // Tchap: remove carousel
- /// Clears the drag offset and informs the view model to switch to another page if necessary.
- /// - Parameter viewSize: The size of the view in which the gesture took place.
- private func handleDragGestureEnded(_ drag: DragGesture.Value, viewSize: CGSize) {
- guard shouldSwipeForTranslation(drag.predictedEndTranslation.width) else {
- // Reset the offset just in case.
- withAnimation { dragOffset = 0 }
- return
- }
-
- withAnimation(.easeInOut(duration: 0.2)) {
- if drag.predictedEndTranslation.width < -viewSize.width / 2 {
- viewModel.send(viewAction: .nextPage)
- } else if drag.predictedEndTranslation.width > viewSize.width / 2 {
- viewModel.send(viewAction: .previousPage)
- }
-
- dragOffset = 0
- }
- }
+// /// Starts the animation timer for an automatic carousel effect.
+// private func startTimer() {
+// guard pageTimer == nil else { return }
+//
+// pageTimer = Timer.scheduledTimer(withTimeInterval: 5, repeats: true) { _ in
+// if viewModel.pageIndex == pageCount - 1 {
+// viewModel.send(viewAction: .hiddenPage)
+//
+// withAnimation(.easeInOut(duration: 0.7)) {
+// viewModel.send(viewAction: .nextPage)
+// }
+// } else {
+// withAnimation(.easeInOut(duration: 0.7)) {
+// viewModel.send(viewAction: .nextPage)
+// }
+// }
+// }
+// }
+//
+// /// Stops the animation timer for manual interaction.
+// private func stopTimer() {
+// guard let pageTimer = pageTimer else { return }
+//
+// self.pageTimer = nil
+// pageTimer.invalidate()
+// }
+//
+// /// The offset to apply to the `HStack` of pages.
+// private func pageOffset(in geometry: GeometryProxy) -> CGFloat {
+// (CGFloat(viewModel.pageIndex + 1) * -geometry.size.width) + dragOffset
+// }
+//
+// // MARK: - Gestures
+//
+// /// Whether or not a drag gesture is valid or not.
+// /// - Parameter width: The gesture's translation width.
+// /// - Returns: `true` if there is another page to drag to.
+// private func shouldSwipeForTranslation(_ width: CGFloat) -> Bool {
+// if viewModel.pageIndex == 0 {
+// return isLeftToRight ? width < 0 : width > 0
+// } else if viewModel.pageIndex == pageCount - 1 {
+// return isLeftToRight ? width > 0 : width < 0
+// }
+//
+// return true
+// }
+//
+// /// Updates the `dragOffset` based on the gesture's value.
+// /// - Parameter drag: The drag gesture value to handle.
+// private func handleDragGestureChange(_ drag: DragGesture.Value) {
+// guard shouldSwipeForTranslation(drag.translation.width) else { return }
+//
+// stopTimer()
+//
+// // Animate the change over a few frames to smooth out any stuttering.
+// withAnimation(.linear(duration: 0.05)) {
+// dragOffset = isLeftToRight ? drag.translation.width : -drag.translation.width
+// }
+// }
+//
+// /// Clears the drag offset and informs the view model to switch to another page if necessary.
+// /// - Parameter viewSize: The size of the view in which the gesture took place.
+// private func handleDragGestureEnded(_ drag: DragGesture.Value, viewSize: CGSize) {
+// guard shouldSwipeForTranslation(drag.predictedEndTranslation.width) else {
+// // Reset the offset just in case.
+// withAnimation { dragOffset = 0 }
+// return
+// }
+//
+// withAnimation(.easeInOut(duration: 0.2)) {
+// if drag.predictedEndTranslation.width < -viewSize.width / 2 {
+// viewModel.send(viewAction: .nextPage)
+// } else if drag.predictedEndTranslation.width > viewSize.width / 2 {
+// viewModel.send(viewAction: .previousPage)
+// }
+//
+// dragOffset = 0
+// }
+// }
}
// MARK: - Previews
diff --git a/Tchap/Modules/Welcome/WelcomeCoordinator.swift b/Tchap/Modules/Welcome/WelcomeCoordinator.swift
deleted file mode 100644
index b7e8175cec..0000000000
--- a/Tchap/Modules/Welcome/WelcomeCoordinator.swift
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- Copyright 2018 New Vector Ltd
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-import Foundation
-
-protocol WelcomeCoordinatorDelegate: AnyObject {
- func welcomeCoordinatorUserDidAuthenticate(_ coordinator: WelcomeCoordinatorType)
-}
-
-final class WelcomeCoordinator: WelcomeCoordinatorType {
-
- // MARK: - Properties
-
- // MARK: Private
-
- private let navigationRouter: NavigationRouterType
- private let welcomeViewController: WelcomeViewController
-
- // MARK: Public
-
- var childCoordinators: [Coordinator] = []
-
- weak var delegate: WelcomeCoordinatorDelegate?
-
- // MARK: - Setup
-
- init() {
- let navController = RiotNavigationController()
- navController.modalPresentationStyle = .fullScreen
- self.navigationRouter = NavigationRouter(navigationController: navController)
-
- let welcomeViewController = WelcomeViewController.instantiate()
- welcomeViewController.vc_removeBackTitle()
- self.welcomeViewController = welcomeViewController
- }
-
- // MARK: - Public methods
-
- func start() {
- self.navigationRouter.setRootModule(self.welcomeViewController, hideNavigationBar: true, animated: false, popCompletion: nil)
- self.welcomeViewController.delegate = self
- }
-
- func toPresentable() -> UIViewController {
- return self.navigationRouter.toPresentable()
- }
-
- // MARK: - Private methods
-
- @MainActor private func showAuthentication() async {
- let authService = AuthenticationService.shared
- await updateAuthServiceForDirectAuthentication()
- let parameters = AuthenticationLoginCoordinatorParameters(navigationRouter: self.navigationRouter,
- authenticationService: authService,
- loginMode: .password)
- let authenticationLoginCoordinator = AuthenticationLoginCoordinator(parameters: parameters)
- authenticationLoginCoordinator.callback = { [weak self] result in
- guard let self = self else { return }
- self.delegate?.welcomeCoordinatorUserDidAuthenticate(self)
- }
- authenticationLoginCoordinator.start()
- self.add(childCoordinator: authenticationLoginCoordinator)
-
- if navigationRouter.modules.isEmpty {
- navigationRouter.setRootModule(authenticationLoginCoordinator, popCompletion: nil)
- } else {
- navigationRouter.push(authenticationLoginCoordinator, animated: true) { [weak self] in
- self?.remove(childCoordinator: authenticationLoginCoordinator)
- }
- }
- }
-
- // Start login flow by updating AuthenticationService
- private func updateAuthServiceForDirectAuthentication() async {
- let authService = AuthenticationService.shared
- authService.reset()
- do {
- try await authService.startFlow(.login)
- } catch {
- MXLog.error("[WelcomeCoordinator] Unable to start flow for login.")
- }
- }
-
- @MainActor private func showRegistration() async {
- let authenticationService = AuthenticationService.shared
- do {
- try await authenticationService.startFlow(.register)
- } catch {
- MXLog.error("[WelcomeCoordinator] showRegistration error")
- }
- guard let registrationWizard = authenticationService.registrationWizard else {
- return
- }
- let parameters = AuthenticationVerifyEmailCoordinatorParameters(registrationWizard: registrationWizard,
- homeserver: authenticationService.state.homeserver)
- let coordinator = AuthenticationVerifyEmailCoordinator(parameters: parameters)
- coordinator.callback = { [weak self] result in
- guard let self = self else { return }
- switch result {
- case .cancel:
- MXLog.warning("[WelcomeCoordinator] Registration cancelled")
- self.cancelRegisterFlow()
- case .completed(let registrationResult):
- switch registrationResult {
- case .success:
- self.delegate?.welcomeCoordinatorUserDidAuthenticate(self)
- case .flowResponse:
- MXLog.warning("[WelcomeCoordinator] flowResponse")
- }
- }
- }
-
- coordinator.start()
- add(childCoordinator: coordinator)
-
- if navigationRouter.modules.isEmpty {
- navigationRouter.setRootModule(coordinator, popCompletion: nil)
- } else {
- navigationRouter.push(coordinator, animated: true) { [weak self] in
- self?.remove(childCoordinator: coordinator)
- }
- }
- }
-
- /// Cancels the registration flow, returning to the Welcome screen.
- private func cancelRegisterFlow() {
- navigationRouter.popAllModules(animated: false)
- }
-}
-
-// MARK: - WelcomeViewControllerDelegate
-extension WelcomeCoordinator: WelcomeViewControllerDelegate {
- @MainActor func welcomeViewControllerDidTapLoginButton(_ welcomeViewController: WelcomeViewController) {
- Task {
- await self.showAuthentication()
- }
- }
-
- @MainActor func welcomeViewControllerDidTapRegisterButton(_ welcomeViewController: WelcomeViewController) {
- Task {
- await self.showRegistration()
- }
- }
-}
diff --git a/Tchap/Modules/Welcome/WelcomeCoordinatorBridgePresenter.swift b/Tchap/Modules/Welcome/WelcomeCoordinatorBridgePresenter.swift
deleted file mode 100644
index 5ae6c26267..0000000000
--- a/Tchap/Modules/Welcome/WelcomeCoordinatorBridgePresenter.swift
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// Copyright 2022 New Vector Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-import Foundation
-
-/// WelcomeCoordinatorBridgePresenter enables to start WelcomeCoordinator from a view controller.
-/// This bridge is used while waiting for global usage of coordinator pattern.
-/// **WARNING**: This class breaks the Coordinator abstraction and it has been introduced for **Objective-C compatibility only** (mainly for integration in legacy view controllers). Each bridge should be removed
-/// once the underlying Coordinator has been integrated by another Coordinator.
-@objcMembers
-final class WelcomeCoordinatorBridgePresenter: NSObject {
-
- // MARK: - Constants
-
- private enum NavigationType {
- case present
- case push
- }
-
- // MARK: - Properties
-
- // MARK: Private
-
- private var navigationType: NavigationType = .present
- private var coordinator: WelcomeCoordinator?
-
- // MARK: Public
-
- var completion: (() -> Void)?
-
- // MARK: - Public
-
- func present(from viewController: UIViewController, animated: Bool) {
- let welcomeCoordinator = makeWelcomeCoordinator()
-
- let presentable = welcomeCoordinator.toPresentable()
- presentable.modalPresentationStyle = .fullScreen
- presentable.modalTransitionStyle = .crossDissolve
-
- viewController.present(presentable, animated: animated, completion: nil)
- welcomeCoordinator.start()
-
- self.coordinator = welcomeCoordinator
- self.navigationType = .present
- }
-
- func push(from navigationController: UINavigationController, animated: Bool) {
-
- let navigationRouter = NavigationRouterStore.shared.navigationRouter(for: navigationController)
-
- let welcomeCoordinator = makeWelcomeCoordinator(navigationRouter: navigationRouter)
-
- welcomeCoordinator.start() // Will trigger the view controller push
-
- self.coordinator = welcomeCoordinator
- self.navigationType = .push
- }
-
- func dismiss(animated: Bool, completion: (() -> Void)?) {
- guard let coordinator = self.coordinator else {
- return
- }
-
- switch navigationType {
- case .present:
- // Dismiss modal
- coordinator.toPresentable().dismiss(animated: animated) {
- self.coordinator = nil
-
- if let completion = completion {
- completion()
- }
- }
- case .push:
- // Pop view controller from UINavigationController
- guard let navigationController = coordinator.toPresentable() as? UINavigationController else {
- return
- }
- navigationController.popViewController(animated: animated)
- self.coordinator = nil
-
- if let completion = completion {
- completion()
- }
- }
- }
-
- // MARK: - Private
-
- /// Makes an `WelcomeCoordinator` using the supplied navigation router, or creating one if needed.
- private func makeWelcomeCoordinator(navigationRouter: NavigationRouterType? = nil) -> WelcomeCoordinator {
- let welcomeCoordinator = WelcomeCoordinator()
- welcomeCoordinator.delegate = self
- return welcomeCoordinator
- }
-}
-
-// MARK: - WelcomeCoordinatorDelegate
-extension WelcomeCoordinatorBridgePresenter: WelcomeCoordinatorDelegate {
- func welcomeCoordinatorUserDidAuthenticate(_ coordinator: WelcomeCoordinatorType) {
- self.completion?()
- }
-}
diff --git a/Tchap/Modules/Welcome/WelcomeCoordinatorType.swift b/Tchap/Modules/Welcome/WelcomeCoordinatorType.swift
deleted file mode 100644
index aedbc99eb3..0000000000
--- a/Tchap/Modules/Welcome/WelcomeCoordinatorType.swift
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Copyright 2018 New Vector Ltd
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-import Foundation
-
-/// `WelcomeCoordinatorType` is a protocol describing a Coordinator that handle welcome navigation flow.
-protocol WelcomeCoordinatorType: Coordinator, Presentable {
-}
diff --git a/Tchap/Modules/Welcome/WelcomeViewController.storyboard b/Tchap/Modules/Welcome/WelcomeViewController.storyboard
deleted file mode 100644
index 61015ae9a3..0000000000
--- a/Tchap/Modules/Welcome/WelcomeViewController.storyboard
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Tchap/Modules/Welcome/WelcomeViewController.swift b/Tchap/Modules/Welcome/WelcomeViewController.swift
deleted file mode 100644
index f283b6df30..0000000000
--- a/Tchap/Modules/Welcome/WelcomeViewController.swift
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- Copyright 2018 New Vector Ltd
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-protocol WelcomeViewControllerDelegate: AnyObject {
- func welcomeViewControllerDidTapLoginButton(_ welcomeViewController: WelcomeViewController)
- func welcomeViewControllerDidTapRegisterButton(_ welcomeViewController: WelcomeViewController)
-}
-
-final class WelcomeViewController: UIViewController {
-
- // MARK: - Properties
-
- // MARK: Outlets
-
- @IBOutlet private weak var titleLabel: UILabel!
- @IBOutlet private weak var registerButton: UIButton!
- @IBOutlet private weak var loginButton: UIButton!
- @IBOutlet private weak var buttonsSeparatorView: UIView!
-
- // MARK: Private
-
- private var theme: Theme!
-
- // MARK: Public
-
- weak var delegate: WelcomeViewControllerDelegate?
-
- // MARK: - Setup
-
- class func instantiate() -> WelcomeViewController {
- let viewController = StoryboardScene.WelcomeViewController.initialScene.instantiate()
- return viewController
- }
-
- // MARK: - Life cycle
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
-
- self.title = TchapL10n.authenticationTitle
-
- self.setupViews()
-
- self.registerThemeServiceDidChangeThemeNotification()
- self.theme = ThemeService.shared().theme
- self.update(theme: self.theme)
- }
-
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
-
- self.navigationController?.setNavigationBarHidden(true, animated: animated)
- }
-
- override func viewWillDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
-
- self.navigationController?.setNavigationBarHidden(false, animated: animated)
- }
-
- override var preferredStatusBarStyle: UIStatusBarStyle {
- return ThemeService.shared().theme.statusBarStyle
- }
-
- // MARK: - Private
-
- private func setupViews() {
- self.titleLabel.text = TchapL10n.welcomeTitle
-
- self.registerButton.setTitle(TchapL10n.welcomeRegisterAction, for: .normal)
- self.registerButton.titleLabel?.numberOfLines = 0
-
- self.loginButton.setTitle(TchapL10n.welcomeLoginAction, for: .normal)
- self.loginButton.titleLabel?.numberOfLines = 0
- }
-
- private func registerThemeServiceDidChangeThemeNotification() {
- NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil)
- }
-
- @objc private func themeDidChange() {
- self.update(theme: ThemeService.shared().theme)
- }
-
- // MARK: - Actions
-
- @IBAction private func loginButtonAction(_ sender: Any) {
- self.delegate?.welcomeViewControllerDidTapLoginButton(self)
- }
-
- @IBAction private func registerButtonAction(_ sender: Any) {
- self.delegate?.welcomeViewControllerDidTapRegisterButton(self)
- }
-}
-
-// MARK: - Theme
-private extension WelcomeViewController {
- private func update(theme: Theme) {
- self.theme = theme
-
- self.view.backgroundColor = theme.backgroundColor
- self.titleLabel.textColor = theme.textTertiaryColor
- self.buttonsSeparatorView.backgroundColor = theme.selectedBackgroundColor
-
- theme.applyStyle(onButton: self.loginButton)
- theme.applyStyle(onButton: self.registerButton)
- }
-}
diff --git a/Tchap/SupportingFiles/App-Common.xcconfig b/Tchap/SupportingFiles/App-Common.xcconfig
index 61a5d51db5..a31699bd97 100644
--- a/Tchap/SupportingFiles/App-Common.xcconfig
+++ b/Tchap/SupportingFiles/App-Common.xcconfig
@@ -24,6 +24,7 @@ BUNDLE_DISPLAY_NAME = Tchap
BASE_BUNDLE_IDENTIFIER = fr.gouv.tchap
APPLICATION_GROUP_IDENTIFIER = group.$(BASE_BUNDLE_IDENTIFIER)
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER)
+APPLICATION_SCHEME = tchap
INFOPLIST_FILE = Tchap/SupportingFiles/Info.plist
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
diff --git a/Tchap/SupportingFiles/Info.plist b/Tchap/SupportingFiles/Info.plist
index 666cd98359..1ef2ea6ab4 100644
--- a/Tchap/SupportingFiles/Info.plist
+++ b/Tchap/SupportingFiles/Info.plist
@@ -35,6 +35,19 @@
$(MARKETING_VERSION)
CFBundleSignature
????
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLName
+ $(BASE_BUNDLE_IDENTIFIER)
+ CFBundleURLSchemes
+
+ $(APPLICATION_SCHEME)
+
+
+
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
ITSAppUsesNonExemptEncryption
diff --git a/changelog.d/1083.feature b/changelog.d/1083.feature
new file mode 100644
index 0000000000..39225afdd3
--- /dev/null
+++ b/changelog.d/1083.feature
@@ -0,0 +1 @@
+Activer la connexion par SSO
\ No newline at end of file