diff --git a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0667008b4..5090a25ab 100644 --- a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -153,15 +153,6 @@ "version" : "2.1.0" } }, - { - "identity" : "pspdfkit-sp", - "kind" : "remoteSourceControl", - "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", - "state" : { - "branch" : "master", - "revision" : "e9757beadad1b30de84073d3c33c1cd0f7a94b80" - } - }, { "identity" : "sovran-swift", "kind" : "remoteSourceControl", diff --git a/apple/OmnivoreKit/Package.swift b/apple/OmnivoreKit/Package.swift index f5ef78249..58f0d3de0 100644 --- a/apple/OmnivoreKit/Package.swift +++ b/apple/OmnivoreKit/Package.swift @@ -56,7 +56,7 @@ let package = Package( var appPackageDependencies: [Target.Dependency] { var deps: [Target.Dependency] = ["Views", "Services", "Models", "Utils"] // #if canImport(UIKit) - deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) +// deps.append(.product(name: "PSPDFKit", package: "PSPDFKit-SP")) // #endif return deps } @@ -70,7 +70,7 @@ var dependencies: [Package.Dependency] { .package(url: "https://github.com/google/GoogleSignIn-iOS", from: "6.2.2") ] // #if canImport(UIKit) - deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", branch: "master")) +// deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", branch: "master")) // #endif return deps } diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/ShareExtensionViewModel.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/ShareExtensionViewModel.swift index 06f6b7f6a..12daff8c1 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/ShareExtensionViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/ShareExtensionViewModel.swift @@ -91,7 +91,7 @@ public class ShareExtensionViewModel: ObservableObject { self.queueSaveOperation(payload) #else Task { - await createPage(services: self.services, pageScrapePayload: payload) + await self.createPage(pageScrapePayload: payload) } #endif case .failure: diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift index 8a5c1688c..1f327fd83 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/ProfileView.swift @@ -40,7 +40,7 @@ import Views do { try await dataService.deleteAccount(userID: currentViewer.unwrappedUserID) - authenticator.logout(dataService: dataService) + authenticator.logout(dataService: dataService, isAccountDeletion: true) } catch { deleteAccountErrorMessage = "We were unable to delete your account." } diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift index 2b8e71003..d06681338 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift @@ -56,6 +56,7 @@ import Views Task { do { try await dataService.validateUsernamePublisher(username: username) + potentialUsernameStatus = .available } catch { let usernameError = (error as? UsernameAvailabilityError) ?? .unknown switch usernameError { @@ -152,6 +153,9 @@ struct CreateProfileView: View { .font(.appFootnote) .foregroundColor(.appGrayText) TextField("", text: $viewModel.potentialUsername) + #if os(iOS) + .textInputAutocapitalization(.never) + #endif } if viewModel.potentialUsernameStatus == .available { diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 6905cd969..f7361e714 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -8,6 +8,7 @@ struct WelcomeView: View { @EnvironmentObject var dataService: DataService @EnvironmentObject var authenticator: Authenticator @Environment(\.horizontalSizeClass) var horizontalSizeClass + @Environment(\.openURL) var openURL @StateObject private var viewModel = RegistrationViewModel() @@ -20,6 +21,9 @@ struct WelcomeView: View { @State private var selectedEnvironment = AppEnvironment.initialAppEnvironment @State private var containerSize: CGSize = .zero + // swiftlint:disable:next line_length + let deletedAccountConfirmationMessage = "Your account has been deleted. Additional steps may be needed if Sign in with Apple was used to register." + func handleHiddenGestureAction() { if !Bundle.main.isAppStoreBuild { showDebugModal = true @@ -132,7 +136,7 @@ struct WelcomeView: View { } var authProviderButtonStack: some View { - let useHorizontalLayout = containerSize.width > 400 + let useHorizontalLayout = containerSize.width > 500 let buttonGroup = Group { AppleSignInButton { @@ -166,7 +170,7 @@ struct WelcomeView: View { } public var body: some View { - ZStack(alignment: .leading) { + ZStack(alignment: viewModel.registrationState == nil ? .leading : .center) { Color.appBackground .edgesIgnoringSafeArea(.all) .modifier(SizeModifier()) @@ -189,7 +193,7 @@ struct WelcomeView: View { logoView .padding(.bottom, 20) headlineView - if containerSize.width > 400 { + if containerSize.width > 500 { authProviderButtonStack } else { HStack { @@ -205,6 +209,12 @@ struct WelcomeView: View { .sheet(isPresented: $showDebugModal) { DebugMenuView(selectedEnvironment: $selectedEnvironment) } + .alert(deletedAccountConfirmationMessage, isPresented: $authenticator.showAppleRevokeTokenAlert) { + Button("View Details") { + openURL(URL(string: "https://support.apple.com/en-us/HT210426")!) + } + Button("Dismiss") { self.authenticator.showAppleRevokeTokenAlert = false } + } } } .preferredColorScheme(.light) diff --git a/apple/OmnivoreKit/Sources/Services/Authentication/Authenticator.swift b/apple/OmnivoreKit/Sources/Services/Authentication/Authenticator.swift index 432508e68..b0ccfba59 100644 --- a/apple/OmnivoreKit/Sources/Services/Authentication/Authenticator.swift +++ b/apple/OmnivoreKit/Sources/Services/Authentication/Authenticator.swift @@ -18,6 +18,7 @@ public final class Authenticator: ObservableObject { } @Published public internal(set) var isLoggedIn: Bool + @Published public var showAppleRevokeTokenAlert = false let networker: Networker @@ -36,11 +37,12 @@ public final class Authenticator: ObservableObject { ValetKey.authToken.value() } - public func logout(dataService: DataService) { + public func logout(dataService: DataService, isAccountDeletion: Bool = false) { dataService.resetCoreData() clearCreds() Authenticator.unregisterIntercomUser?() isLoggedIn = false + showAppleRevokeTokenAlert = isAccountDeletion } public func clearCreds() {