hotfix use custom url scheme to open links if provided

This commit is contained in:
JanNiklas Grabowski
2023-12-22 12:25:59 +01:00
parent 59ee43ed5c
commit 5decccf6cb
18 changed files with 106 additions and 22 deletions

View File

@@ -86,7 +86,7 @@ class AuthenticationLoginViewModel: AuthenticationLoginViewModelType, Authentica
message: BWIL10n.bwiDeprecatedVersionWarningMessage,
primaryButton: (BWIL10n.bwiDeprecatedVersionAppstoreButton, {
UIApplication.shared.open(URL(string: BWIBuildSettings.shared.itunesAppLink)!)
UIApplication.shared.vc_open(URL(string: BWIBuildSettings.shared.itunesAppLink)!, completionHandler: nil)
}),
secondaryButton: (VectorL10n.ok, {}))

View File

@@ -218,9 +218,8 @@ struct AuthenticationLoginScreen: View {
return
}
let tosURL = URL.init(string: urlString)! // add your link here
if UIApplication.shared.canOpenURL(tosURL) {
UIApplication.shared.open(tosURL)
}
UIApplication.shared.vc_open(tosURL, completionHandler: nil)
}, label: {
Text(BWIL10n.authenticationDataprivacyText)
.font(theme.fonts.footnote)

View File

@@ -130,7 +130,7 @@ final class AuthenticationServerSelectionCoordinator: Coordinator, Presentable {
stopLoading()
let primaryButtonCompletion: (() -> Void)? = { () in
if let url = URL(string: BWIBuildSettings.shared.bumAdvertizementURLString) {
UIApplication.shared.open(url)
UIApplication.shared.vc_open(url, completionHandler: nil)
}
}

View File

@@ -263,7 +263,7 @@ struct AuthenticationServerSelectionScreen: View {
return Alert(
title: Text(BWIL10n.authenticationServerSelectionServerDeniedTitle),
message: Text(BWIL10n.authenticationServerSelectionServerDeniedMessage),
primaryButton: .default(Text(BWIL10n.authenticationServerSelectionServerDeniedAdvertizementWebsiteButton), action: {UIApplication.shared.open(url)}),
primaryButton: .default(Text(BWIL10n.authenticationServerSelectionServerDeniedAdvertizementWebsiteButton), action: {UIApplication.shared.vc_open(url, completionHandler: nil)}),
secondaryButton: .default(Text(VectorL10n.ok)))
} else {